/** -*- C++ -*- @file adept/application.h @author Peter Rockai */ #include #include #include #include #include #ifndef EPT_APPLICATION_H #define EPT_APPLICATION_H class KStatusBar; namespace adept { using namespace aptFront; using cache::Cache; class Lister; struct Application : cache::Observer { Application(); void setAcceptReadOnly( bool ro ) { m_acceptReadOnly = ro; } bool writeable() { return cache::Global::get().writeable(); } Cache &cache() { return cache::Global::get(); } void openCache( unsigned flags = Cache::OpenDefault | Cache::OpenDebtags ); void initialize(); void initKDEDebconf(); void initHistory(); void setMainWidget( TQWidget *w ) { m_main = w; } void setStatusBar( KStatusBar *s ); virtual void checkpoint(); virtual void undo(); virtual void redo(); virtual void notifyPostChange( cache::component::Base * ); TQString changeString(); TQString statusString(); TQString sizesString(); protected: virtual void setHistoryEnabled( bool ) {} typedef cache::component::History< cache::component::State > History; virtual History *history() { return m_history; } bool m_acceptReadOnly; TQWidget *m_main; KStatusBar *m_statusBar; History *m_history; }; /* class WaitForLister : public TQObject { Q_OBJECT public: WaitForLister( TQObject *a, const char *s ) : obj( a ), slot( s ) { waiting(); } void addLister( Lister *l ) { listers.push_back( l ); } protected slots: void waiting(); protected: TQObject *obj; const char *slot; typedef std::vector< Lister * > Vector; Vector listers; }; */ } #endif