• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeprint
 

kdeprint

kmmanager.h
00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <kdeprint@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 KMMANAGER_H
00021 #define KMMANAGER_H
00022 
00023 #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
00024 #warning internal header, do not use except if you are a KDEPrint developer
00025 #endif
00026 
00027 #include <kdeprint/kmprinter.h>
00028 
00029 #include <tqobject.h>
00030 #include <tqstring.h>
00031 #include <tqptrlist.h>
00032 
00033 class DrMain;
00034 class KMDBEntry;
00035 class KMVirtualManager;
00036 class KMSpecialManager;
00037 class TQWidget;
00038 class KActionCollection;
00039 class PrinterFilter;
00040 
00048 class KDEPRINT_EXPORT KMManager : public TQObject
00049 {
00050     Q_OBJECT
00051 
00052 friend class KMVirtualManager;
00053 friend class KMSpecialManager;
00054 friend class KMFactory;
00055 
00056 public:
00057     enum PrinterOperations {
00058         PrinterEnabling  = 0x01,
00059         PrinterCreation  = 0x02,
00060         PrinterDefault   = 0x04,
00061         PrinterTesting   = 0x08,
00062         PrinterConfigure = 0x10,
00063         PrinterRemoval   = 0x20,
00064         PrinterAll       = 0xFF
00065     };
00066     enum ServerOperations {
00067         ServerRestarting = 0x1,
00068         ServerConfigure  = 0x2,
00069         ServerAll        = 0xF
00070     };
00071 
00072     KMManager(TQObject *parent = 0, const char *name = 0);
00073     virtual ~KMManager();
00074 
00075     static KMManager* self();
00076 
00077     // error management functions
00078     TQString errorMsg() const       { return m_errormsg; }
00079     void setErrorMsg(const TQString& s) { m_errormsg = s; }
00080 
00081     // support management ?
00082     bool hasManagement() const      { return m_hasmanagement; }
00083 
00084     // printer management functions
00085     virtual bool createPrinter(KMPrinter *p);
00086     virtual bool removePrinter(KMPrinter *p);
00087     virtual bool enablePrinter(KMPrinter *p, bool on);
00088     virtual bool startPrinter(KMPrinter *p, bool on);
00089     virtual bool completePrinter(KMPrinter *p);
00090     virtual bool completePrinterShort(KMPrinter *p);
00091     virtual bool setDefaultPrinter(KMPrinter *p);
00092     virtual bool testPrinter(KMPrinter *p);
00093     bool upPrinter(KMPrinter *p, bool state);
00094     bool modifyPrinter(KMPrinter *oldp, KMPrinter *newp);
00095     bool removePrinter(const TQString& name);
00096     bool enablePrinter(const TQString& name, bool state);
00097     bool startPrinter(const TQString& name, bool state);
00098     bool completePrinter(const TQString& name);
00099     bool setDefaultPrinter(const TQString& name);
00100     int printerOperationMask() const    { return m_printeroperationmask; }
00101     int addPrinterWizard(TQWidget *parent = 0);
00102 
00103     // special printer management functions
00104     bool createSpecialPrinter(KMPrinter *p);
00105     bool removeSpecialPrinter(KMPrinter *p);
00106 
00107     // printer listing functions
00108     KMPrinter* findPrinter(const TQString& name);
00109     TQPtrList<KMPrinter>* printerList(bool reload = true);
00110     TQPtrList<KMPrinter>* printerListComplete(bool reload = true);
00111     KMPrinter* defaultPrinter();
00112     void enableFilter(bool on);
00113     bool isFilterEnabled() const;
00114 
00115     // driver DB functions
00116     virtual TQString driverDbCreationProgram();
00117     virtual TQString driverDirectory();
00118 
00119     // driver functions
00120     virtual DrMain* loadPrinterDriver(KMPrinter *p, bool config = false);
00121     virtual DrMain* loadDbDriver(KMDBEntry *entry);
00122     virtual DrMain* loadFileDriver(const TQString& filename);
00123     DrMain* loadDriver(KMPrinter *p, bool config = false);
00124     virtual bool savePrinterDriver(KMPrinter *p, DrMain *d);
00125     virtual bool validateDbDriver(KMDBEntry *entry);
00126 
00127     // configuration functions
00128     bool invokeOptionsDialog(TQWidget *parent = 0);
00129     virtual TQString stateInformation();
00130 
00131     // server functions
00132     int serverOperationMask() const     { return m_serveroperationmask; }
00133     virtual bool restartServer();
00134     virtual bool configureServer(TQWidget *parent = 0);
00135     virtual TQStringList detectLocalPrinters();
00136 
00137     // additional actions (for print manager)
00138     virtual void createPluginActions(KActionCollection*);
00139     virtual void validatePluginActions(KActionCollection*, KMPrinter*);
00140 
00141     // utility function
00142     void checkUpdatePossible();
00143 
00144 signals:
00145     void updatePossible(bool);
00146     void printerListUpdated();
00147 
00148 protected:
00149     // the real printer listing job is done here
00150     virtual void listPrinters();
00151 
00152     // utility functions
00153     void addPrinter(KMPrinter *p);  // in any case, the pointer given MUST not be used after
00154                     // calling this function. Useful when listing printers.
00155     void setHardDefault(KMPrinter*);
00156     void setSoftDefault(KMPrinter*);
00157     KMPrinter* softDefault() const;
00158     KMPrinter* hardDefault() const;
00159     // this function uncompress the given file (or does nothing
00160     // if the file is not compressed). Returns wether the file was
00161     // compressed or not.
00162     bool uncompressFile(const TQString& srcname, TQString& destname);
00163     bool notImplemented();
00164     void setHasManagement(bool on)      { m_hasmanagement = on; }
00165     void setPrinterOperationMask(int m) { m_printeroperationmask = m; }
00166     void setServerOperationMask(int m)  { m_serveroperationmask = m; }
00167     TQString testPage();
00168     void discardAllPrinters(bool);
00169     void setUpdatePossible( bool );
00170     virtual void checkUpdatePossibleInternal();
00171 
00172 protected:
00173     QString         m_errormsg;
00174     KMPrinterList       m_printers, m_fprinters;    // filtered printers
00175     bool            m_hasmanagement;
00176     int         m_printeroperationmask;
00177     int             m_serveroperationmask;
00178     KMSpecialManager    *m_specialmgr;
00179     KMVirtualManager    *m_virtualmgr;
00180     PrinterFilter   *m_printerfilter;
00181     bool m_updatepossible;
00182 };
00183 
00184 #endif

kdeprint

Skip menu "kdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeprint

Skip menu "kdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeprint by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |