"Fossies" - the Fresh Open Source Software Archive

Member "evolution-brutus-1.2.35/camel/camel-brutus-folder.h" (3 Apr 2008, 3734 Bytes) of archive /linux/misc/old/evolution-brutus-1.2.35.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "camel-brutus-folder.h" see the Fossies "Dox" file reference documentation.

    1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
    2 
    3 /*
    4  *    Camel Brutus folder class.
    5  *
    6  *    Authors:
    7  *        Jules Colding <colding@42tools.com>
    8  *
    9  *    Copyright (C) 2005-2007 OMC Denmark ApS.
   10  *
   11  *    This program is free software; you can redistribute it and/or modify
   12  *    it under the terms of the GNU General Public License as published by
   13  *    the Free Software Foundation; either version 2 of the License, or
   14  *    (at your option) any later version.
   15  *
   16  *    This program is distributed in the hope that it will be useful,
   17  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   18  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   19  *    GNU General Public License for more details.
   20  *
   21  *    You should have received a copy of the GNU General Public License
   22  *    along with this program; if not, write to the Free Software
   23  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   24  *    MA 02111-1307 USA
   25  */
   26 
   27 #ifndef CAMEL_BRUTUS_FOLDER_H
   28 #define CAMEL_BRUTUS_FOLDER_H 1
   29 
   30 #include <camel/camel-mime-message.h>
   31 #include <camel/camel-folder.h>
   32 #include <camel/camel-offline-folder.h>
   33 #include <camel/camel-folder-summary.h>
   34 #include <camel/camel-internet-address.h>
   35 #include <camel/camel-data-cache.h>
   36 #include <camel/camel-multipart.h>
   37 
   38 #include "camel-brutus-store.h"
   39 
   40 #include <idl_output/IMAPIFolder.h>
   41 
   42 G_BEGIN_DECLS
   43 
   44 #define FOLDER_MESSAGE_CACHE "message_cache"
   45 #define MESSAGE_CACHE_TIMEOUT 86400 /* 24 hours */
   46 
   47 #define CAMEL_BRUTUS_FOLDER_TYPE     (camel_brutus_folder_get_type ())
   48 #define CAMEL_BRUTUS_FOLDER(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_BRUTUS_FOLDER_TYPE, CamelBrutusFolder))
   49 #define CAMEL_BRUTUS_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_BRUTUS_FOLDER_TYPE, CamelBrutusFolderClass))
   50 #define CAMEL_IS_BRUTUS_FOLDER(o)    (CAMEL_CHECK_TYPE((o), CAMEL_BRUTUS_FOLDER_TYPE))
   51 
   52 typedef struct _CamelBrutusFolder CamelBrutusFolder;
   53 typedef struct _CamelBrutusFolderClass CamelBrutusFolderClass;
   54 
   55 struct _CamelBrutusFolder {
   56     CamelOfflineFolder parent_object;
   57 
   58     CamelFolderSearch *search;
   59 
   60     GMutex *summary_mutex;   // serialize folder summary operations
   61     GMutex *cache_mutex;     // serialize message cache operations
   62     GMutex *finalize_mutex;  // will signal to the caching thread that it shall terminate
   63 
   64     GThread *offline_caching_thread; // thread to monitor sync_offline being checked
   65 
   66     // message cache
   67     CamelDataCache *msg_cache;
   68 
   69     // Message stores are misinterpreted as real folders by Evolution. 
   70     // We must therefore be able to destinguish the real folders. 
   71     gboolean is_a_folder;
   72 
   73     // TRUE if this is an online folder. Offline folders are
   74     // strictly read-only
   75     gboolean online;
   76 
   77     // Brutus objects
   78     BRUTUS_IMAPISession mapi_session;
   79     BRUTUS_IMAPIFolder mapi_folder;
   80 
   81     // Must ping this before trying to establish any kind of
   82     // CORBA connection or we will just wait for ever 
   83     // in pthread_cond_wait()
   84     gchar *brutus_server;
   85 
   86     char session_key[37]; // uuid to distinguish between different run-time sessions in the summary header
   87 };
   88 
   89 struct _CamelBrutusFolderClass {
   90     CamelOfflineFolderClass parent_class;
   91 
   92     /* Virtual methods */
   93 };
   94 
   95 /* Standard Camel function */
   96 extern CamelType camel_brutus_folder_get_type(void);
   97 
   98 extern CamelFolder *camel_brutus_folder_new_offline(CamelStore *store,
   99                             const char *folder_name,
  100                             guint32 flags,
  101                             CamelException *ex);
  102 
  103 extern CamelFolder *camel_brutus_folder_new(CamelStore *store,
  104                         const char *folder_name,
  105                         guint32 flags,
  106                         CamelException *ex);
  107 
  108 extern CamelFolder *camel_brutus_folder_wrap(CamelStore *store,
  109                          BRUTUS_IMAPIFolder mapi_folder,
  110                          CamelException *ex);
  111 
  112 G_END_DECLS
  113 
  114 #endif /* CAMEL_BRUTUS_FOLDER_H */