Changeset 1339

Show
Ignore:
Timestamp:
12/25/06 22:25:16
Author:
pvanhoof
Message:

API changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/tny-camel-mime-part.c

    r1327 r1339  
    105105 
    106106                        } else 
    107                                 newpart = tny_camel_mime_part_new (tpart); 
     107                                newpart = tny_camel_mime_part_new_with_part (tpart); 
    108108 
    109109                        tny_list_prepend (list, G_OBJECT (newpart)); 
     
    788788 * tny_camel_mime_part_new: 
    789789 *  
     790 * Return value: A new #TnyMimePart instance implemented for Camel 
     791 **/ 
     792TnyMimePart* 
     793tny_camel_mime_part_new (void) 
     794{ 
     795        TnyCamelMimePart *self = g_object_new (TNY_TYPE_CAMEL_MIME_PART, NULL); 
     796        CamelMimePart *cpart = camel_mime_part_new (); 
     797 
     798        _tny_camel_mime_part_set_part (self, cpart); 
     799 
     800        return TNY_MIME_PART (self); 
     801} 
     802 
     803 
     804/** 
     805 * tny_camel_mime_part_new_with_part: 
     806 *  
    790807 * The #TnyMimePart implementation is actually a proxy for #CamelMimePart. 
    791808 * 
     
    793810 **/ 
    794811TnyMimePart* 
    795 tny_camel_mime_part_new (CamelMimePart *part) 
     812tny_camel_mime_part_new_with_part (CamelMimePart *part) 
    796813{ 
    797814        TnyCamelMimePart *self = g_object_new (TNY_TYPE_CAMEL_MIME_PART, NULL); 
  • trunk/libtinymail-camel/tny-camel-mime-part.h

    r1327 r1339  
    7474GType tny_camel_mime_part_get_type (void); 
    7575 
    76 TnyMimePart* tny_camel_mime_part_new (CamelMimePart *part); 
     76TnyMimePart* tny_camel_mime_part_new_with_part (CamelMimePart *part); 
     77TnyMimePart* tny_camel_mime_part_new (void); 
    7778 
    7879CamelMimePart* tny_camel_mime_part_get_part (TnyCamelMimePart *self); 
  • trunk/libtinymail-camel/tny-camel-msg.c

    r1240 r1339  
    227227        TnyCamelMsg *self = g_object_new (TNY_TYPE_CAMEL_MSG, NULL); 
    228228 
     229        _tny_camel_mime_part_set_part (TNY_CAMEL_MIME_PART (self),  
     230                CAMEL_MIME_PART (camel_mime_message_new ())); 
     231 
    229232        tny_camel_msg_set_header (TNY_MSG (self), header); 
    230233 
     
    232235} 
    233236 
     237/** 
     238 * tny_camel_msg_new_with_part: 
     239 * @part: a #CamelMimePart object 
     240 * 
     241 * The #TnyMsg implementation is actually a proxy for #CamelMimePart. 
     242 * 
     243 * Return value: A new #TnyMsg instance implemented for Camel 
     244 **/ 
     245TnyMsg* 
     246tny_camel_msg_new_with_part (CamelMimePart *part) 
     247{ 
     248        TnyCamelMsg *self = g_object_new (TNY_TYPE_CAMEL_MSG, NULL); 
     249 
     250        _tny_camel_mime_part_set_part (TNY_CAMEL_MIME_PART (self),  
     251                CAMEL_MIME_PART (camel_mime_message_new ())); 
     252 
     253        return TNY_MSG (self); 
     254} 
     255 
     256/** 
     257 * tny_camel_msg_new_with_part_and_header: 
     258 * @part: a #CamelMimePart object 
     259 * @header: a #TnyHeader object 
     260 *  
     261 * The #TnyMsg implementation is actually a proxy for #CamelMimePart. 
     262 * 
     263 * Return value: A new #TnyMsg instance implemented for Camel 
     264 **/ 
     265TnyMsg* 
     266tny_camel_msg_new_with_part_and_header (CamelMimePart *part, TnyHeader *header) 
     267{ 
     268        TnyCamelMsg *self = g_object_new (TNY_TYPE_CAMEL_MSG, NULL); 
     269 
     270        _tny_camel_mime_part_set_part (TNY_CAMEL_MIME_PART (self), part); 
     271        tny_camel_msg_set_header (TNY_MSG (self), header); 
     272 
     273        return TNY_MSG (self); 
     274} 
    234275 
    235276static void 
  • trunk/libtinymail-camel/tny-camel-msg.h

    r1194 r1339  
    6161TnyMsg* tny_camel_msg_new (void); 
    6262TnyMsg* tny_camel_msg_new_with_header (TnyHeader *header); 
     63TnyMsg* tny_camel_msg_new_with_part (CamelMimePart *part); 
     64TnyMsg* tny_camel_msg_new_with_part_and_header (CamelMimePart *part, TnyHeader *header); 
     65 
    6366 
    6467G_END_DECLS 
  • trunk/libtinymail-gnome-desktop/tny-gnome-platform-factory.c

    r1171 r1339  
    2121#include <tny-gnome-platform-factory.h> 
    2222 
    23 #include <tny-account-store.h> 
    2423#include <tny-gnome-account-store.h> 
    25  
    26 #include <tny-device.h> 
    2724#include <tny-gnome-device.h> 
    28  
    29 #include <tny-msg-view.h> 
     25#include <tny-camel-header.h> 
     26#include <tny-camel-mime-part.h> 
     27#include <tny-camel-msg.h> 
    3028 
    3129#ifdef MOZEMBED 
     
    4442 
    4543 
     44static TnyMsg* 
     45tny_gnome_platform_factory_new_msg (TnyPlatformFactory *self) 
     46{ 
     47        return tny_camel_msg_new (); 
     48} 
     49 
     50 
     51static TnyMimePart* 
     52tny_gnome_platform_factory_new_mime_part (TnyPlatformFactory *self) 
     53{ 
     54        return tny_camel_mime_part_new (); 
     55} 
     56 
     57 
     58static TnyHeader* 
     59tny_gnome_platform_factory_new_header (TnyPlatformFactory *self) 
     60{ 
     61        return tny_camel_header_new (); 
     62} 
     63 
     64 
    4665static TnyAccountStore* 
    4766tny_gnome_platform_factory_new_account_store (TnyPlatformFactory *self) 
    4867{ 
    49         return TNY_ACCOUNT_STORE (tny_gnome_account_store_new ()); 
     68        return tny_gnome_account_store_new (); 
    5069} 
    5170 
     
    5372tny_gnome_platform_factory_new_device (TnyPlatformFactory *self) 
    5473{ 
    55         return TNY_DEVICE (tny_gnome_device_new ()); 
     74        return tny_gnome_device_new (); 
    5675} 
    5776 
     
    102121        klass->new_device_func = tny_gnome_platform_factory_new_device; 
    103122        klass->new_msg_view_func = tny_gnome_platform_factory_new_msg_view; 
     123        klass->new_msg_func = tny_gnome_platform_factory_new_msg; 
     124        klass->new_mime_part_func = tny_gnome_platform_factory_new_mime_part; 
     125        klass->new_header_func = tny_gnome_platform_factory_new_header; 
    104126 
    105127        return; 
  • trunk/libtinymail-gpe/tny-gpe-platform-factory.c

    r994 r1339  
    2020 
    2121#include <tny-gpe-platform-factory.h> 
    22  
    23 #include <tny-account-store.h> 
    2422#include <tny-gpe-account-store.h> 
    25  
    26 #include <tny-device.h> 
    2723#include <tny-gpe-device.h> 
    28  
    29 #include <tny-msg-view.h> 
    3024#include <tny-gtk-msg-view.h> 
     25#include <tny-camel-header.h> 
     26#include <tny-camel-mime-part.h> 
     27#include <tny-camel-msg.h> 
    3128 
    3229static GObjectClass *parent_class = NULL; 
     
    3633{ 
    3734        return; 
     35} 
     36 
     37 
     38 
     39static TnyMsg* 
     40tny_gpe_platform_factory_new_msg (TnyPlatformFactory *self) 
     41{ 
     42        return tny_camel_msg_new (); 
     43} 
     44 
     45 
     46static TnyMimePart* 
     47tny_gpe_platform_factory_new_mime_part (TnyPlatformFactory *self) 
     48{ 
     49        return tny_camel_mime_part_new (); 
     50} 
     51 
     52 
     53static TnyHeader* 
     54tny_gpe_platform_factory_new_header (TnyPlatformFactory *self) 
     55{ 
     56        return tny_camel_header_new (); 
    3857} 
    3958 
     
    89108        klass->new_device_func = tny_gpe_platform_factory_new_device; 
    90109        klass->new_msg_view_func = tny_gpe_platform_factory_new_msg_view; 
     110        klass->new_msg_func = tny_gpe_platform_factory_new_msg; 
     111        klass->new_mime_part_func = tny_gpe_platform_factory_new_mime_part; 
     112        klass->new_header_func = tny_gpe_platform_factory_new_header; 
    91113 
    92114        return; 
  • trunk/libtinymail-maemo/tny-maemo-platform-factory.c

    r994 r1339  
    2121#include <tny-maemo-platform-factory.h> 
    2222 
    23 #include <tny-account-store.h> 
    2423#include <tny-maemo-account-store.h> 
    25  
    26 #include <tny-device.h> 
    2724#include <tny-maemo-device.h> 
    28  
    29 #include <tny-msg-view.h> 
    3025#include <tny-gtk-msg-view.h> 
     26#include <tny-camel-header.h> 
     27#include <tny-camel-mime-part.h> 
     28#include <tny-camel-msg.h> 
    3129 
    3230static GObjectClass *parent_class = NULL; 
     
    3634{ 
    3735        return; 
     36} 
     37 
     38 
     39 
     40 
     41 
     42static TnyMsg* 
     43tny_maemo_platform_factory_new_msg (TnyPlatformFactory *self) 
     44{ 
     45        return tny_camel_msg_new (); 
     46} 
     47 
     48 
     49static TnyMimePart* 
     50tny_maemo_platform_factory_new_mime_part (TnyPlatformFactory *self) 
     51{ 
     52        return tny_camel_mime_part_new (); 
     53} 
     54 
     55 
     56static TnyHeader* 
     57tny_maemo_platform_factory_new_header (TnyPlatformFactory *self) 
     58{ 
     59        return tny_camel_header_new (); 
    3860} 
    3961 
     
    91113        klass->new_device_func = tny_maemo_platform_factory_new_device; 
    92114        klass->new_msg_view_func = tny_maemo_platform_factory_new_msg_view; 
     115        klass->new_msg_func = tny_maemo_platform_factory_new_msg; 
     116        klass->new_mime_part_func = tny_maemo_platform_factory_new_mime_part; 
     117        klass->new_header_func = tny_maemo_platform_factory_new_header; 
    93118 
    94119        return; 
  • trunk/libtinymail-olpc/tny-olpc-platform-factory.c

    r994 r1339  
    2121#include <tny-olpc-platform-factory.h> 
    2222 
    23 #include <tny-account-store.h> 
    2423#include <tny-olpc-account-store.h> 
    25  
    26 #include <tny-device.h> 
    2724#include <tny-olpc-device.h> 
    28  
    29 #include <tny-msg-view.h> 
    3025#include <tny-gtk-msg-view.h> 
     26#include <tny-camel-header.h> 
     27#include <tny-camel-mime-part.h> 
     28#include <tny-camel-msg.h> 
    3129 
    3230static GObjectClass *parent_class = NULL; 
     
    3836} 
    3937 
     38 
     39 
     40static TnyMsg* 
     41tny_olpc_platform_factory_new_msg (TnyPlatformFactory *self) 
     42{ 
     43        return tny_camel_msg_new (); 
     44} 
     45 
     46 
     47static TnyMimePart* 
     48tny_olpc_platform_factory_new_mime_part (TnyPlatformFactory *self) 
     49{ 
     50        return tny_camel_mime_part_new (); 
     51} 
     52 
     53 
     54static TnyHeader* 
     55tny_olpc_platform_factory_new_header (TnyPlatformFactory *self) 
     56{ 
     57        return tny_camel_header_new (); 
     58} 
    4059 
    4160static TnyAccountStore* 
     
    91110        klass->new_device_func = tny_olpc_platform_factory_new_device; 
    92111        klass->new_msg_view_func = tny_olpc_platform_factory_new_msg_view; 
     112        klass->new_msg_func = tny_olpc_platform_factory_new_msg; 
     113        klass->new_mime_part_func = tny_olpc_platform_factory_new_mime_part; 
     114        klass->new_header_func = tny_olpc_platform_factory_new_header; 
    93115 
    94116        return; 
  • trunk/libtinymail-test/tny-list-test.c

    r1336 r1339  
    119119    if (num == 2) 
    120120    { 
    121         *a = (GObject*) tny_camel_mime_part_new (camel_mime_part_new ()); 
    122         *b = (GObject*) tny_camel_mime_part_new (camel_mime_part_new ()); 
    123         *c = (GObject*) tny_camel_mime_part_new (camel_mime_part_new ()); 
    124         *d = (GObject*) tny_camel_mime_part_new (camel_mime_part_new ()); 
     121        *a = (GObject*) tny_camel_mime_part_new (); 
     122        *b = (GObject*) tny_camel_mime_part_new (); 
     123        *c = (GObject*) tny_camel_mime_part_new (); 
     124        *d = (GObject*) tny_camel_mime_part_new (); 
    125125    } 
    126126 
  • trunk/libtinymail-test/tny-mime-part-test.c

    r1309 r1339  
    4141        camel_object_unref (CAMEL_OBJECT (addr)); 
    4242 
    43         CamelMimePart *cpart = camel_mime_part_new (); 
    44         iface = TNY_MIME_PART (tny_camel_mime_part_new (cpart)); 
     43        iface = tny_camel_mime_part_new (); 
    4544 
    4645        return; 
  • trunk/libtinymail-test/tny-msg-test.c

    r1334 r1339  
    7575        gint length = 0; 
    7676        TnyList *parts = tny_simple_list_new(); 
    77         CamelMimePart *cpart = camel_mime_part_new (); 
    78         TnyMimePart *part = TNY_MIME_PART (tny_camel_mime_part_new (cpart)); 
     77        TnyMimePart *part = tny_camel_mime_part_new_ (); 
    7978     
    8079        tny_mime_part_add_part (TNY_MIME_PART (iface), part); 
  • trunk/libtinymailui/tny-platform-factory.c

    r1198 r1339  
    2424 
    2525#include <tny-platform-factory.h> 
     26 
     27 
     28/** 
     29 * tny_platform_factory_new_header: 
     30 * @self: a TnyPlatformFactory object 
     31 * 
     32 * Create a new #TnyMsg instance. The returned instance must be  
     33 * unreferenced after use. 
     34 * 
     35 * Implementors: when implementing a platform-specific library, return a  
     36 * new #TnyMsg instance. 
     37 * 
     38 * Return value: a #TnyMsg instance 
     39 **/ 
     40TnyMsg*  
     41tny_platform_factory_new_msg (TnyPlatformFactory *self) 
     42{ 
     43#ifdef DEBUG 
     44        if (!TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_msg_func) 
     45                g_critical ("You must implement tny_platform_factory_new_msg\n"); 
     46#endif 
     47 
     48        return TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_msg_func (self); 
     49 
     50} 
     51 
     52 
     53/** 
     54 * tny_platform_factory_new_header: 
     55 * @self: a TnyPlatformFactory object 
     56 * 
     57 * Create a new #TnyMimePart instance. The returned instance must be  
     58 * unreferenced after use. 
     59 * 
     60 * Implementors: when implementing a platform-specific library, return a  
     61 * new #TnyMimePart instance. 
     62 * 
     63 * Return value: a #TnyMimePart instance 
     64 **/ 
     65TnyMimePart*  
     66tny_platform_factory_new_mime_part (TnyPlatformFactory *self) 
     67{ 
     68#ifdef DEBUG 
     69        if (!TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_mime_part_func) 
     70                g_critical ("You must implement tny_platform_factory_new_mime_part\n"); 
     71#endif 
     72 
     73        return TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_mime_part_func (self); 
     74} 
     75 
     76/** 
     77 * tny_platform_factory_new_header: 
     78 * @self: a TnyPlatformFactory object 
     79 * 
     80 * Create a new #TnyHeader instance. The returned instance must be  
     81 * unreferenced after use. 
     82 * 
     83 * Implementors: when implementing a platform-specific library, return a  
     84 * new #TnyHeader instance. 
     85 * 
     86 * Return value: a #TnyHeader instance 
     87 **/ 
     88TnyHeader*  
     89tny_platform_factory_new_header (TnyPlatformFactory *self) 
     90{ 
     91#ifdef DEBUG 
     92        if (!TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_header_func) 
     93                g_critical ("You must implement tny_platform_factory_new_header\n"); 
     94#endif 
     95 
     96        return TNY_PLATFORM_FACTORY_GET_IFACE (self)->new_header_func (self); 
     97} 
    2698 
    2799/** 
  • trunk/libtinymailui/tny-platform-factory.h

    r900 r1339  
    4545        TnyDevice* (*new_device_func) (TnyPlatformFactory *self); 
    4646        TnyMsgView* (*new_msg_view_func) (TnyPlatformFactory *self); 
     47        TnyMsg* (*new_msg_func) (TnyPlatformFactory *self); 
     48        TnyMimePart* (*new_mime_part_func) (TnyPlatformFactory *self); 
     49        TnyHeader* (*new_header_func) (TnyPlatformFactory *self); 
    4750}; 
    4851 
     
    5255TnyDevice* tny_platform_factory_new_device (TnyPlatformFactory *self); 
    5356TnyMsgView* tny_platform_factory_new_msg_view (TnyPlatformFactory *self); 
     57TnyMsg* tny_platform_factory_new_msg (TnyPlatformFactory *self); 
     58TnyMimePart* tny_platform_factory_new_mime_part (TnyPlatformFactory *self); 
     59TnyHeader* tny_platform_factory_new_header (TnyPlatformFactory *self); 
     60 
    5461 
    5562G_END_DECLS