- Main Page
- Namespaces
- Classes
- Files

# AppInstanceManager.h

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 2002 Murray Cumming
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the Free
    00016  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00017  */
    00018
    00019 #ifndef BAKERY_APPINSTANCEMANAGER_H
    00020 #define BAKERY_APPINSTANCEMANAGER_H
    00021
    00022 #include <sigc++/sigc++.h>
    00023 #include <list>
    00024
    00025 namespace Bakery
    00026 {
    00027
    00028 class App;
    00029
    00036 class AppInstanceManager : public sigc::trackable
    00037 {
    00038 public:
    00039   AppInstanceManager();
    00040   virtual ~AppInstanceManager();
    00041
    00042   virtual void add_app(App* pApp);
    00043   virtual void close_all();
    00044   virtual void cancel_close_all();
    00045
    00046   virtual unsigned int get_app_count() const;
    00047
    00048   typedef std::list<App*> type_listAppInstances;
    00049   virtual type_listAppInstances get_instances() const; //Used by App_WithDoc to get associated Documents.
    00050
    00051 protected:
    00052   //Signal handler:
    00053   virtual void on_app_hide(App* pApp);
    00054
    00055   //Instances:
    00056   type_listAppInstances m_listAppInstances;
    00057
    00058   bool m_bExiting;
    00059 };
    00060
    00061 } //namespace
    00062
    00063 #endif //BAKERY_APPINSTANCEMANAGER_H