Changeset 521

Show
Ignore:
Timestamp:
06/14/06 15:50:05
Author:
pvanhoof
Message:

Interface cleanups

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/tny-msg-folder.c

    r491 r521  
    664664                message = TNY_MSG_IFACE (tny_msg_new ()); 
    665665 
    666                 tny_msg_iface_set_folder (message, self); 
     666                _tny_msg_set_folder (message, self); 
    667667                tny_msg_iface_set_header (message, TNY_MSG_HEADER_IFACE (header)); 
    668668                _tny_msg_set_camel_mime_message (TNY_MSG (message), camel_message); 
  • trunk/libtinymail-camel/tny-msg-priv.h

    r483 r521  
    3838}; 
    3939 
    40 CamelMimeMessage*  _tny_msg_get_camel_mime_message    (TnyMsg *self); 
    41 void               _tny_msg_set_camel_mime_message    (TnyMsg *self, CamelMimeMessage *message, gboolean pop); 
    42 void               _tny_msg_header_set_not_uncachable  (TnyMsgHeader *self); 
     40CamelMimeMessage* _tny_msg_get_camel_mime_message (TnyMsg *self); 
     41void _tny_msg_set_camel_mime_message (TnyMsg *self, CamelMimeMessage *message, gboolean pop); 
     42void _tny_msg_header_set_not_uncachable (TnyMsgHeader *self); 
     43void _tny_msg_set_folder (TnyMsgIface *self, const TnyMsgFolderIface *folder); 
    4344 
    4445#endif 
  • trunk/libtinymail-camel/tny-msg.c

    r483 r521  
    191191 
    192192void 
    193 tny_msg_set_folder (TnyMsgIface *self, const TnyMsgFolderIface* folder) 
     193_tny_msg_set_folder (TnyMsgIface *self, const TnyMsgFolderIface* folder) 
    194194{ 
    195195        TnyMsgPriv *priv = TNY_MSG_GET_PRIVATE (TNY_MSG (self)); 
     
    465465        klass->add_part_func = tny_msg_add_part; 
    466466        klass->del_part_func = tny_msg_del_part; 
    467         klass->set_folder_func = tny_msg_set_folder; 
    468467        klass->get_folder_func = tny_msg_get_folder; 
    469468 
  • trunk/libtinymail/tny-msg-header-iface.c

    r398 r521  
    3535tny_msg_header_iface_set_replyto (TnyMsgHeaderIface *self, const gchar *to) 
    3636{ 
     37#ifdef DEBUG 
     38        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_replyto_func) 
     39                g_critical ("You must implement tny_msg_header_iface_set_replyto\n"); 
     40#endif   
     41 
    3742        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_replyto_func (self, to); 
    3843        return; 
     
    5055tny_msg_header_iface_get_replyto (TnyMsgHeaderIface *self) 
    5156{ 
     57#ifdef DEBUG 
     58        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_replyto_func) 
     59                g_critical ("You must implement tny_msg_header_iface_get_replyto\n"); 
     60#endif 
    5261        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_replyto_func (self); 
    5362} 
     
    6574tny_msg_header_iface_set_bcc (TnyMsgHeaderIface *self, const gchar *bcc) 
    6675{ 
     76#ifdef DEBUG 
     77        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_bcc_func) 
     78                g_critical ("You must implement tny_msg_header_iface_set_bcc\n"); 
     79#endif 
     80 
    6781        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_bcc_func (self, bcc); 
    6882        return; 
     
    8195tny_msg_header_iface_set_cc (TnyMsgHeaderIface *self, const gchar *cc) 
    8296{ 
     97#ifdef DEBUG 
     98        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_cc_func) 
     99                g_critical ("You must implement tny_msg_header_iface_set_cc\n"); 
     100#endif 
     101 
    83102        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_cc_func (self, cc); 
    84103        return; 
     
    96115tny_msg_header_iface_set_from (TnyMsgHeaderIface *self, const gchar *from) 
    97116{ 
     117#ifdef DEBUG 
     118        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_from_func) 
     119                g_critical ("You must implement tny_msg_header_iface_set_from\n"); 
     120#endif 
     121 
    98122        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_from_func (self, from); 
    99123        return; 
     
    111135tny_msg_header_iface_set_subject (TnyMsgHeaderIface *self, const gchar *subject) 
    112136{ 
     137#ifdef DEBUG 
     138        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_subject_func) 
     139                g_critical ("You must implement tny_msg_header_iface_set_subject\n"); 
     140#endif 
     141 
    113142        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_subject_func (self, subject); 
    114143        return; 
     
    130159tny_msg_header_iface_set_to (TnyMsgHeaderIface *self, const gchar *to) 
    131160{ 
     161#ifdef DEBUG 
     162        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_to_func) 
     163                g_critical ("You must implement tny_msg_header_iface_set_to\n"); 
     164#endif 
     165 
    132166        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_to_func (self, to); 
    133167        return; 
     
    145179tny_msg_header_iface_get_cc (TnyMsgHeaderIface *self) 
    146180{ 
     181#ifdef DEBUG 
     182        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_cc_func) 
     183                g_critical ("You must implement tny_msg_header_iface_get_cc\n"); 
     184#endif 
     185 
    147186        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_cc_func (self); 
    148187} 
     
    159198tny_msg_header_iface_get_bcc (TnyMsgHeaderIface *self) 
    160199{ 
     200#ifdef DEBUG 
     201        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_bcc_func) 
     202                g_critical ("You must implement tny_msg_header_iface_get_bcc\n"); 
     203#endif 
     204 
    161205        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_bcc_func (self); 
    162206} 
     
    173217tny_msg_header_iface_get_date_received (TnyMsgHeaderIface *self) 
    174218{ 
     219#ifdef DEBUG 
     220        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_date_received_func) 
     221                g_critical ("You must implement tny_msg_header_iface_get_date_received\n"); 
     222#endif 
     223 
    175224        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_date_received_func (self); 
    176225} 
     
    187236tny_msg_header_iface_get_date_sent (TnyMsgHeaderIface *self) 
    188237{ 
     238#ifdef DEBUG 
     239        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_date_sent_func) 
     240                g_critical ("You must implement tny_msg_header_iface_get_date_sent\n"); 
     241#endif 
     242 
    189243        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_date_sent_func (self); 
    190244} 
     
    202256tny_msg_header_iface_get_uid (TnyMsgHeaderIface *self) 
    203257{ 
     258#ifdef DEBUG 
     259        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_uid_func) 
     260                g_critical ("You must implement tny_msg_header_iface_get_uid\n"); 
     261#endif 
     262 
    204263        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_uid_func (self); 
    205264} 
     
    216275tny_msg_header_iface_get_message_id (TnyMsgHeaderIface *self) 
    217276{ 
     277#ifdef DEBUG 
     278        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_message_id_func) 
     279                g_critical ("You must implement tny_msg_header_iface_get_message_id\n"); 
     280#endif 
     281 
    218282        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_message_id_func (self); 
    219283} 
     
    230294tny_msg_header_iface_get_from (TnyMsgHeaderIface *self) 
    231295{ 
     296#ifdef DEBUG 
     297        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_from_func) 
     298                g_critical ("You must implement tny_msg_header_iface_get_from\n"); 
     299#endif 
     300 
    232301        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_from_func (self); 
    233302} 
     
    244313tny_msg_header_iface_get_subject (TnyMsgHeaderIface *self) 
    245314{ 
     315#ifdef DEBUG 
     316        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_subject_func) 
     317                g_critical ("You must implement tny_msg_header_iface_get_subject\n"); 
     318#endif 
     319 
    246320        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_subject_func (self); 
    247321} 
     
    259333tny_msg_header_iface_get_to (TnyMsgHeaderIface *self) 
    260334{ 
     335#ifdef DEBUG 
     336        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_to_func) 
     337                g_critical ("You must implement tny_msg_header_iface_get_to\n"); 
     338#endif 
     339 
    261340        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_to_func (self); 
    262341} 
     
    273352tny_msg_header_iface_get_folder (TnyMsgHeaderIface *self) 
    274353{ 
     354#ifdef DEBUG 
     355        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_folder_func) 
     356                g_critical ("You must implement tny_msg_header_iface_get_folder\n"); 
     357#endif 
     358 
    275359        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_folder_func (self); 
    276360} 
     
    286370tny_msg_header_iface_set_folder (TnyMsgHeaderIface *self, const TnyMsgFolderIface *folder) 
    287371{ 
     372#ifdef DEBUG 
     373        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_folder_func) 
     374                g_critical ("You must implement tny_msg_header_iface_set_folder\n"); 
     375#endif 
     376 
    288377        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_folder_func (self, folder); 
    289378        return; 
     
    301390tny_msg_header_iface_get_flags (TnyMsgHeaderIface *self) 
    302391{ 
     392#ifdef DEBUG 
     393        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_flags_func) 
     394                g_critical ("You must implement tny_msg_header_iface_get_flags\n"); 
     395#endif 
     396 
    303397        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->get_flags_func (self); 
    304398} 
     
    315409tny_msg_header_iface_set_flags (TnyMsgHeaderIface *self, TnyMsgHeaderFlags mask) 
    316410{ 
     411#ifdef DEBUG 
     412        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_flags_func) 
     413                g_critical ("You must implement tny_msg_header_iface_set_flags\n"); 
     414#endif 
     415 
    317416        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_flags_func (self, mask); 
    318417} 
     
    329428tny_msg_header_iface_unset_flags (TnyMsgHeaderIface *self, TnyMsgHeaderFlags mask) 
    330429{ 
     430#ifdef DEBUG 
     431        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->unset_flags_func) 
     432                g_critical ("You must implement tny_msg_header_iface_unset_flags\n"); 
     433#endif 
     434 
    331435        return TNY_MSG_HEADER_IFACE_GET_CLASS (self)->unset_flags_func (self, mask); 
    332436} 
     
    342446tny_msg_header_iface_set_uid (TnyMsgHeaderIface *self, const gchar *id) 
    343447{ 
     448#ifdef DEBUG 
     449        if (!TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_uid_func) 
     450                g_critical ("You must implement tny_msg_header_iface_set_uid\n"); 
     451#endif 
     452 
    344453        TNY_MSG_HEADER_IFACE_GET_CLASS (self)->set_uid_func (self, id); 
    345454        return; 
  • trunk/libtinymail/tny-msg-iface.c

    r379 r521  
    3434tny_msg_iface_get_folder (TnyMsgIface *self) 
    3535{ 
     36#ifdef DEBUG 
     37        if (!TNY_MSG_IFACE_GET_CLASS (self)->get_folder_func) 
     38                g_critical ("You must implement tny_msg_iface_get_folder\n"); 
     39#endif 
     40 
    3641        return TNY_MSG_IFACE_GET_CLASS (self)->get_folder_func (self); 
    37 } 
    38  
    39 /** 
    40  * tny_msg_iface_set_folder: 
    41  * @self: a #TnyMsgIface object 
    42  * @folder: The parent folder 
    43  *  
    44  * Set the parent folder of this message 
    45  * 
    46  * * TODO: Make this private, or make it possible to move messages this way * 
    47  * 
    48  **/ 
    49 void 
    50 tny_msg_iface_set_folder (TnyMsgIface *self, const TnyMsgFolderIface *folder) 
    51 { 
    52         TNY_MSG_IFACE_GET_CLASS (self)->set_folder_func (self, folder); 
    53         return; 
    5442} 
    5543 
     
    6654tny_msg_iface_get_parts (TnyMsgIface *self) 
    6755{ 
     56#ifdef DEBUG 
     57        if (!TNY_MSG_IFACE_GET_CLASS (self)->get_parts_func) 
     58                g_critical ("You must implement tny_msg_iface_get_parts\n"); 
     59#endif 
    6860 
    6961        return TNY_MSG_IFACE_GET_CLASS (self)->get_parts_func (self); 
     
    8274tny_msg_iface_get_header (TnyMsgIface *self) 
    8375{ 
     76#ifdef DEBUG 
     77        if (!TNY_MSG_IFACE_GET_CLASS (self)->get_header_func) 
     78                g_critical ("You must implement tny_msg_iface_get_header\n"); 
     79#endif 
     80 
    8481        return TNY_MSG_IFACE_GET_CLASS (self)->get_header_func (self); 
    8582} 
     
    9895tny_msg_iface_add_part (TnyMsgIface *self, TnyMsgMimePartIface *part) 
    9996{ 
     97#ifdef DEBUG 
     98        if (!TNY_MSG_IFACE_GET_CLASS (self)->add_part_func) 
     99                g_critical ("You must implement tny_msg_iface_add_part\n"); 
     100#endif 
     101 
    100102        return TNY_MSG_IFACE_GET_CLASS (self)->add_part_func (self, part); 
    101103} 
     
    112114tny_msg_iface_del_part (TnyMsgIface *self, gint id) 
    113115{ 
     116#ifdef DEBUG 
     117        if (!TNY_MSG_IFACE_GET_CLASS (self)->del_part_func) 
     118                g_critical ("You must implement tny_msg_iface_del_part\n"); 
     119#endif 
     120 
    114121        TNY_MSG_IFACE_GET_CLASS (self)->del_part_func (self, id); 
    115122        return; 
     
    128135tny_msg_iface_set_header (TnyMsgIface *self, TnyMsgHeaderIface *header) 
    129136{ 
     137#ifdef DEBUG 
     138        if (!TNY_MSG_IFACE_GET_CLASS (self)->set_header_func) 
     139                g_critical ("You must implement tny_msg_iface_set_header\n"); 
     140#endif 
     141 
    130142        TNY_MSG_IFACE_GET_CLASS (self)->set_header_func (self, header); 
    131143        return; 
  • trunk/libtinymail/tny-msg-iface.h

    r210 r521  
    4545        const TnyMsgFolderIface* 
    4646                                 (*get_folder_func)       (TnyMsgIface *self); 
    47         void                     (*set_folder_func)       (TnyMsgIface *self, const TnyMsgFolderIface *folder); 
    4847        void                     (*set_header_func)       (TnyMsgIface *self, TnyMsgHeaderIface *header); 
    4948 
     
    6362const TnyMsgFolderIface* 
    6463                         tny_msg_iface_get_folder       (TnyMsgIface *self); 
    65 void                     tny_msg_iface_set_folder       (TnyMsgIface *self, const TnyMsgFolderIface *folder); 
    66  
    6764void                     tny_msg_iface_set_header       (TnyMsgIface *self, TnyMsgHeaderIface *header); 
    6865