home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kmailIface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-02-13  |  9.3 KB  |  220 lines

  1. #ifndef _KMCONTROLIFACE
  2. #define _KMCONTROLIFACE
  3.  
  4. // no forward declarations - dcopidl2cpp won't work
  5. #include <dcopobject.h>
  6. #include <dcopref.h>
  7. #include <kurl.h>
  8. #include <qstringlist.h>
  9.  
  10. /** checkMail wont show reader but will check mail. use openReader to
  11.     show if you give a filename to openReader it will show mbox or
  12.     message if it is valid rfc-822 message or mbox file.  You can pass
  13.     hidden=1 to openComposer and it wont be visible that way you can
  14.     write messages and add attachments from other apps and send it via
  15.     kmail. Should I add showAddressBook? hmm...  The openComposer
  16.     functions always return 1.  sven <radej@kde.org> */
  17. class KMailIface : virtual public DCOPObject
  18. {
  19.   K_DCOP
  20.  
  21. k_dcop:
  22.   virtual void checkMail() = 0;
  23.   virtual QStringList accounts() = 0;
  24.   virtual void checkAccount(const QString &account) = 0;
  25.   virtual void openReader() = 0;
  26.   virtual int openComposer(const QString &to, const QString &cc,
  27.                            const QString &bcc, const QString &subject,
  28.                            const QString &body, int hidden,
  29.                            const KURL &messageFile) = 0;
  30.   virtual int openComposer(const QString &to, const QString &cc,
  31.                            const QString &bcc, const QString &subject,
  32.                            const QString &body, int hidden,
  33.                            const KURL &messageFile,
  34.                            const KURL &attachURL) = 0;
  35.   virtual int openComposer(const QString &to, const QString &cc,
  36.                            const QString &bcc, const QString &subject,
  37.                            const QString &body, int hidden,
  38.                            const KURL &messageFile,
  39.                            const KURL::List &attachURLs) = 0;
  40.   virtual int openComposer (const QString &to, const QString &cc,
  41.                             const QString &bcc, const QString &subject,
  42.                             const QString &body, int hidden,
  43.                             const QString &attachName,
  44.                             const QCString &attachCte,
  45.                             const QCString &attachData,
  46.                             const QCString &attachType,
  47.                             const QCString &attachSubType,
  48.                             const QCString &attachParamAttr,
  49.                             const QString &attachParamValue,
  50.                             const QCString &attachContDisp) = 0;
  51.   virtual int openComposer (const QString &to, const QString &cc,
  52.                             const QString &bcc, const QString &subject,
  53.                             const QString &body, int hidden,
  54.                             const QString &attachName,
  55.                             const QCString &attachCte,
  56.                             const QCString &attachData,
  57.                             const QCString &attachType,
  58.                             const QCString &attachSubType,
  59.                             const QCString &attachParamAttr,
  60.                             const QString &attachParamValue,
  61.                             const QCString &attachContDisp,
  62.                             const QCString &attachCharset) = 0;
  63.   /** Open composer and return reference to DCOP interface of composer window.
  64.     If hidden is true, the window will not be shown. If you use that option,
  65.     it's your responsibility to call the send() function of the composer in
  66.     order to actually send the mail. */
  67.   virtual DCOPRef openComposer(const QString &to, const QString &cc,
  68.                                const QString &bcc, const QString &subject,
  69.                                const QString &body, bool hidden) = 0;
  70.  
  71.     /**
  72.        Send a certificate request to the CA specified in \a to. The
  73.        certificate is stored in the byte array \a certData. It needs
  74.        to stored according to BER and PKCS#10.
  75.        This method will set content type encoding, mime types, etc. as
  76.        per the MailTT specification.
  77.     */
  78.     virtual int sendCertificate( const QString& to,
  79.                                  const QByteArray& certData ) = 0;
  80.  
  81.  
  82.   virtual void compactAllFolders() = 0;
  83.  
  84.   /** @param foldername the requested foldername in kmail (at the
  85.                      zero level in the foldertree.
  86.       @param messagefile the name of the filename (local) with the
  87.                      message to be added.
  88.       @param MsgStatusFlags a string coding the status of the message
  89.              with a char for each status e.g. a 'N' for new
  90.              this param is optional
  91.       @return =1,  message added to folder, if folder doesn't exist, folder
  92.              has been created.
  93.         =0,  an error occurred.
  94.         =-1, couldn't create folder and it didn't exist
  95.         =-2, couldn't read messageFile.
  96.         =-3, Can't allocate memory.
  97.         =-4, Message already exists in folder.
  98.   */
  99.   virtual int dcopAddMessage(const QString & foldername,
  100.                              const QString & messagefile,
  101.                              const QString & MsgStatusFlags = QString()) = 0;
  102.   virtual int dcopAddMessage(const QString & foldername,
  103.                              const KURL & messagefile,
  104.                              const QString & MsgStatusFlags = QString()) = 0;
  105.  
  106.   virtual QStringList folderList() const =0;
  107.   virtual DCOPRef getFolder( const QString& vpath ) =0;
  108.   virtual void selectFolder( QString folder ) =0;
  109.   virtual bool canQueryClose() =0;
  110.  
  111.   /**
  112.    * Set the KMail Default transport.
  113.    * @param transport the name of the transport as defined in the sending
  114.             accounts configuration.
  115.   */
  116.   virtual void setDefaultTransport( const QString & transport ) =0;
  117.  
  118.   virtual int timeOfLastMessageCountChange() const =0;
  119.  
  120.   /**
  121.    * Abort any running compaction/expiry, and don't launch any new ones
  122.    * until resumeBackgroundJobs() is called
  123.    */
  124.   virtual void pauseBackgroundJobs() = 0;
  125.  
  126.   /**
  127.    * Resume compaction/expiry, and allow launching new ones
  128.    */
  129.   virtual void resumeBackgroundJobs() = 0;
  130.  
  131.   /**
  132.    * Stop all network related jobs and enter offline mode
  133.   */
  134.   virtual void stopNetworkJobs() = 0;
  135.  
  136.   /**
  137.    * Resume all network related jobs and enter online mode
  138.   */
  139.   virtual void resumeNetworkJobs() = 0;
  140.  
  141. k_dcop_signals:
  142.   void unreadCountChanged();
  143.  
  144.   void unreadCountChanged( const QString& folderURL, int numUnread );
  145.  
  146. k_dcop_hidden:
  147.   /** DCOP call which is used by the Kontact plugin to create a new message.
  148.    *
  149.    *  @TODO Rename to newMessageInternal()
  150.    *  @TODO Merge this and the various openComposer methods for better code reuse
  151.   */
  152.   virtual DCOPRef newMessage(const QString &to,
  153.                              const QString &cc,
  154.                              const QString& bcc,
  155.                              bool hidden,
  156.                              bool useFolderId,
  157.                              const KURL &messageFile,
  158.                              const KURL &attachURL) = 0;
  159.  
  160.   /** Shows the specified message in a separate message window.
  161.       @param serialNumber the serial number of the message to be shown.
  162.       @param messageId this parameter is ignored.
  163.   */
  164.   /*  @TODO Get rid of the messageId parameter.  */
  165.   virtual bool showMail( Q_UINT32 serialNumber, QString messageId ) = 0;
  166.  
  167.   /**
  168.    * DCOP-enabled for KMailUniqueAppHandler in the kontact plugin
  169.    * @param noArgsOpensReader true in the kmail process, meaning that launching "kmail"
  170.    * will open a reader window or bring to front an existing one.
  171.    * noArgsOpensReader is false when this is called from kontact, so that typing
  172.    * "kmail" doesn't open a window.
  173.    * Returns true if the command line was handled, false if it was empty and
  174.    * not handled (due to noArgsOpensReader==false).
  175.    */
  176.   virtual bool handleCommandLine( bool noArgsOpensReader ) = 0;
  177.   virtual bool firstStart() = 0;
  178.   /**
  179.    *
  180.    * DCOP-enabled for use in kaddressbook drop
  181.    */
  182.   virtual QString getFrom( Q_UINT32 serialNumber ) = 0;
  183.   virtual QString debugScheduler() = 0;
  184.   virtual QString debugSernum( Q_UINT32 serialNumber ) = 0;
  185.  
  186.   /** Does essentially the same as dcopAddMessage except that it doesn't reject
  187.       duplicate messages.
  188.  
  189.       @param foldername the requested foldername in kmail (at the
  190.                      zero level in the foldertree.
  191.       @param messagefile: the name of the filename (local) with the
  192.                      message to be added.
  193.       @param MsgStatusFlags a string coding the status of the message
  194.                      with a char for each status e.g. a 'N' for new
  195.                      this param is optional
  196.       @return =1,  message added to folder, if folder doesn't exist, folder
  197.              has been created.
  198.         =0,  an error occurred.
  199.         =-1, couldn't create folder and it didn't exist
  200.         =-2, couldn't read messageFile.
  201.         =-3, Can't allocate memory.
  202.         =-4, Message already exists in folder.
  203.   */
  204.   virtual int dcopAddMessage_fastImport(const QString & foldername,
  205.                                         const QString & messagefile,
  206.                                         const QString & MsgStatusFlags = QString()) = 0;
  207.   virtual int dcopAddMessage_fastImport(const QString & foldername,
  208.                                         const KURL & messagefile,
  209.                                         const QString & MsgStatusFlags = QString()) = 0;
  210.  
  211.   /** Clears the list of added message ids which is used to filter out
  212.       duplicates. */
  213.   virtual void dcopResetAddMessage() = 0;
  214.   
  215.   virtual void loadProfile( const QString& path ) = 0;
  216.   virtual void saveToProfile( const QString& path ) const = 0;
  217. };
  218.  
  219. #endif
  220.