Back to index

unity  6.0.0
unity-mt-grab-handle-impl-factory.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
00017  */
00018 
00019 #ifndef _UNITY_MT_GRAB_HANDLE_IMPL_FACTORY_H
00020 #define _UNITY_MT_GRAB_HANDLE_IMPL_FACTORY_H
00021 
00022 #include <Nux/Nux.h>
00023 #include <glib.h>
00024 #include <boost/noncopyable.hpp>
00025 #include <boost/shared_ptr.hpp>
00026 #include <boost/enable_shared_from_this.hpp>
00027 #include <boost/weak_ptr.hpp>
00028 
00029 #include "unity-mt-grab-handle.h"
00030 
00031 namespace unity
00032 {
00033 namespace MT
00034 {
00035 class GrabHandle::ImplFactory
00036 {
00037   public:
00038 
00039     virtual ~ImplFactory() {};
00040 
00041     static boost::shared_ptr <ImplFactory>
00042     Default();
00043 
00044     static void
00045     SetDefault(ImplFactory *);
00046 
00047     virtual GrabHandle::Impl * create(const GrabHandle::Ptr &h) = 0;
00048 
00049   protected:
00050 
00051     static boost::shared_ptr <ImplFactory> mDefault;
00052 
00053     ImplFactory() {};
00054 };
00055 };
00056 };
00057 
00058 #endif