D:/develop/v65/clients/outlook/install/output/export/funambol/clients/outlook/mainclientDll/src/include/outlook/ClientApplication.h

00001  /*
00002  * Copyright (C) 2006-2007 Funambol, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
00017 */
00018 
00019 #ifndef INCL_CLIENTAPPLICATION
00020 #define INCL_CLIENTAPPLICATION
00021 
00027 #include "outlook/defs.h"
00028 #include "outlook/ClientFolder.h"
00029 #include "outlook/ClientItem.h"
00030 #include "outlook/ClientMail.h"
00031 #include "outlook/ClientContact.h"
00032 #include "outlook/ClientAppointment.h"
00033 #include "outlook/ClientTask.h"
00034 #include "outlook/ClientNote.h"
00035 
00036 #include <string>
00037 
00038 
00049 class ClientApplication {
00050 
00051 private:
00052 
00054     static ClientApplication* pinstance;
00055 
00057     std::wstring        version;
00059     std::wstring        programName;
00060 
00061 
00062     // Pointers to microsoft outlook objects.
00063     _ApplicationPtr                   pApp;
00064     _NameSpacePtr                     pMAPI;
00065     MAPIFolderPtr                     pFolder;
00066 
00067     // Pointer to Redemption safe objects.
00068     Redemption::IMAPIUtilsPtr         pRedUtils;
00069     Redemption::IRDOSessionPtr        rdoSession;
00070 
00071 
00072     // Internal ClientObjects: 
00073     // 'get..()' methods always return references to these objects
00074     ClientFolder*       folder;
00075     ClientMail*         mail;
00076     ClientContact*      contact;
00077     ClientAppointment*  appointment;
00078     ClientTask*         task;
00079     ClientNote*         note;
00080 
00081 
00083     HRESULT hr;
00084 
00085     void createSafeInstances();
00086 
00087 
00088 protected:
00089 
00090     // Constructor
00091     ClientApplication();
00092 
00093 
00094 public:
00095 
00096     // Method to get the sole instance of ClientApplication
00097     static ClientApplication* getInstance();
00098 
00099     // Returns true if static instance is not NULL.
00100     static bool isInstantiated();
00101 
00102     // Destructor
00103     ~ClientApplication();
00104 
00105 
00106     const std::wstring& getVersion();
00107     const std::wstring& getName();
00108     
00109 
00110     ClientFolder* getDefaultFolder     (const std::wstring& itemType);
00111     ClientFolder* getFolderFromID      (const std::wstring& folderID);
00112     ClientFolder* pickFolder           ();
00113     ClientFolder* pickFolder           (const std::wstring& itemType);
00114     ClientFolder* getFolderFromPath    (const std::wstring& itemType,   const std::wstring& path);
00115     ClientFolder* getDefaultRootFolder ();
00116     ClientFolder* getRootFolder        (const int index);
00117     ClientFolder* getRootFolderFromName(const std::wstring& folderName);
00118 
00119     ClientItem*   getItemFromID   (const std::wstring& itemID, const std::wstring& itemType);
00120 
00121 
00122     // Utility to release shared objects of Outlook session.
00123     HRESULT cleanUp();
00124 
00125     // Utility to convert an Exchange mail address into a SMTP address.
00126     std::wstring getSMTPfromEX(const std::wstring& EXAddress);
00127 
00128     // Utility to get body of a specified item (used for notes body which is protected).
00129     std::wstring getBodyFromID(const std::wstring& itemID);
00130 
00131     // Utility to retrieve the userName of current profile used.
00132     std::wstring getCurrentProfileName();
00133 
00134     // Returns true if Outlook MAPI object is logged on.
00135     const bool isLoggedOn();
00136 };
00137 
00140 #endif

Generated on Fri Nov 9 12:21:26 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2