kmmainview.h
00001 /* 00002 * This file is part of the KDE libraries 00003 * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License version 2 as published by the Free Software Foundation. 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 License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 **/ 00019 00020 #ifndef KMMAINVIEW_H 00021 #define KMMAINVIEW_H 00022 00023 #if !defined( _TDEPRINT_COMPILE ) && defined( __GNUC__ ) 00024 #warning internal header, do not use except if you are a TDEPrint developer 00025 #endif 00026 00027 #include <tqwidget.h> 00028 #include <tdeprint/kpreloadobject.h> 00029 #include <tdemainwindow.h> 00030 00031 class KMManager; 00032 class KMPrinterView; 00033 class KMPrinter; 00034 class KMPages; 00035 class TDEActionCollection; 00036 class TQPopupMenu; 00037 class TQTimer; 00038 class TQSplitter; 00039 class TDEToolBar; 00040 class TDEAction; 00041 class PluginComboBox; 00042 class TQBoxLayout; 00043 class MessageWindow; 00044 class TQMenuBar; 00045 00053 class TDEPRINT_EXPORT KMMainView : public TQWidget, public KPReloadObject 00054 { 00055 Q_OBJECT 00056 public: 00057 KMMainView(TQWidget *parent = 0, const char *name = 0, TDEActionCollection *coll = 0); 00058 ~KMMainView(); 00059 00060 void setOrientation(int); 00061 int orientation() const; 00062 void setViewType(int); 00063 int viewType() const; 00064 void enableToolbar(bool on = true); 00065 TDEAction* action(const char *name); 00066 void showPrinterInfos(bool on); 00067 bool printerInfosShown() const; 00068 00069 public slots: 00070 void slotTimer(); 00071 void slotShowPrinterInfos(bool); 00072 void slotChangePrinterState(); 00073 void slotRemove(); 00074 void slotConfigure(); 00075 void slotAdd(); 00076 void slotHardDefault(); 00077 void slotSoftDefault(); 00078 void slotTest(); 00079 void slotServerRestart(); 00080 void slotServerConfigure(); 00081 void slotServerConfigureAccess(); 00082 void slotManagerConfigure(); 00083 void slotAddSpecial(); 00084 void slotRefresh(); 00085 void slotToolSelected(int); 00086 void slotToggleFilter(bool); 00087 00088 protected slots: 00089 void slotPrinterSelected(const TQString&); 00090 void slotRightButtonClicked(const TQString&, const TQPoint&); 00091 void slotToggleToolBar(bool); 00092 void slotToggleMenuBar(bool); 00093 void slotChangeView(int); 00094 void slotChangeDirection(int); 00095 void slotUpdatePossible( bool ); 00096 void slotInit(); 00097 00098 protected: 00099 void initActions(); 00100 void showErrorMsg(const TQString& msg, bool usemgr = true); 00101 void restoreSettings(); 00102 void saveSettings(); 00103 void loadParameters(); 00104 void reload(); 00105 void configChanged(); 00106 //void aboutToReload(); 00107 void loadPluginActions(); 00108 void removePluginActions(); 00109 void createMessageWindow( const TQString&, int delay = 500 ); 00110 void destroyMessageWindow(); 00111 void reset( const TQString& msg = TQString::null, bool useDelay = true, bool holdTimer = true ); 00112 00113 private: 00114 KMPrinterView *m_printerview; 00115 KMPages *m_printerpages; 00116 TQPopupMenu *m_pop; 00117 TDEActionCollection *m_actions; 00118 KMPrinter *m_current; 00119 TDEToolBar *m_toolbar; 00120 PluginComboBox *m_plugin; 00121 int m_pactionsindex; 00122 TQStringList m_toollist; 00123 bool m_first; 00124 TQBoxLayout *m_boxlayout; 00125 class TDEMainWindowPrivate; 00126 TDEMainWindowPrivate *d; 00127 TDEToolBar *m_menubar; 00128 }; 00129 00130 TDEPRINT_EXPORT int tdeprint_management_add_printer_wizard( TQWidget* parent ); 00131 00132 #endif