Changeset 522

Show
Ignore:
Timestamp:
06/14/06 15:55:53
Author:
pvanhoof
Message:

Interface cleanups

Files:

Legend:

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

    r408 r522  
    3232tny_msg_mime_part_iface_is_attachment (TnyMsgMimePartIface *self) 
    3333{ 
     34#ifdef DEBUG 
     35        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->is_attachment_func) 
     36                g_critical ("You must implement tny_msg_mime_part_iface_is_attachment\n"); 
     37#endif 
    3438        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->is_attachment_func (self); 
    3539} 
     
    4751tny_msg_mime_part_iface_set_content_location (TnyMsgMimePartIface *self, const gchar *content_location) 
    4852{ 
     53#ifdef DEBUG 
     54        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_location_func) 
     55                g_critical ("You must implement tny_msg_mime_part_iface_set_content_location\n"); 
     56#endif 
     57 
    4958        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_location_func (self, content_location); 
    5059        return; 
     
    6271tny_msg_mime_part_iface_set_description (TnyMsgMimePartIface *self, const gchar *description) 
    6372{ 
     73#ifdef DEBUG 
     74        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_description_func) 
     75                g_critical ("You must implement tny_msg_mime_part_iface_set_description\n"); 
     76#endif 
     77 
    6478        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_description_func (self, description); 
    6579        return; 
     
    7791tny_msg_mime_part_iface_set_content_id (TnyMsgMimePartIface *self, const gchar *content_id) 
    7892{ 
     93#ifdef DEBUG 
     94        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_id_func) 
     95                g_critical ("You must implement tny_msg_mime_part_iface_set_content_id\n"); 
     96#endif 
     97 
    7998        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_id_func (self, content_id); 
    8099        return; 
     
    92111tny_msg_mime_part_iface_set_filename (TnyMsgMimePartIface *self, const gchar *filename) 
    93112{ 
     113#ifdef DEBUG 
     114        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_filename_func) 
     115                g_critical ("You must implement tny_msg_mime_part_iface_set_filename\n"); 
     116#endif 
     117 
    94118        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_filename_func (self, filename); 
    95119        return; 
     
    107131tny_msg_mime_part_iface_set_content_type (TnyMsgMimePartIface *self, const gchar *content_type) 
    108132{ 
     133#ifdef DEBUG 
     134        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_type_func) 
     135                g_critical ("You must implement tny_msg_mime_part_iface_set_content_type\n"); 
     136#endif 
     137 
    109138        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->set_content_type_func (self, content_type); 
    110139        return; 
     
    122151tny_msg_mime_part_iface_get_filename (TnyMsgMimePartIface *self) 
    123152{ 
     153#ifdef DEBUG 
     154        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_filename_func) 
     155                g_critical ("You must implement tny_msg_mime_part_iface_get_filename\n"); 
     156#endif 
     157 
    124158        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_filename_func (self); 
    125159} 
     
    135169tny_msg_mime_part_iface_get_content_id (TnyMsgMimePartIface *self) 
    136170{ 
     171#ifdef DEBUG 
     172        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_id_func) 
     173                g_critical ("You must implement tny_msg_mime_part_iface_get_content_id\n"); 
     174#endif 
     175 
    137176        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_id_func (self); 
    138177} 
     
    148187tny_msg_mime_part_iface_get_description (TnyMsgMimePartIface *self) 
    149188{ 
     189#ifdef DEBUG 
     190        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_description_func) 
     191                g_critical ("You must implement tny_msg_mime_part_iface_get_description\n"); 
     192#endif 
     193 
    150194        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_description_func (self); 
    151195} 
     
    161205tny_msg_mime_part_iface_get_content_location (TnyMsgMimePartIface *self) 
    162206{ 
     207#ifdef DEBUG 
     208        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_location_func) 
     209                g_critical ("You must implement tny_msg_mime_part_iface_get_content_location\n"); 
     210#endif 
     211 
    163212        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_location_func (self); 
    164213} 
     
    177226tny_msg_mime_part_iface_write_to_stream (TnyMsgMimePartIface *self, TnyStreamIface *stream) 
    178227{ 
     228#ifdef DEBUG 
     229        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->write_to_stream_func) 
     230                g_critical ("You must implement tny_msg_mime_part_iface_write_to_stream\n"); 
     231#endif 
     232 
    179233        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->write_to_stream_func (self, stream); 
    180234        return; 
     
    195249tny_msg_mime_part_iface_decode_to_stream (TnyMsgMimePartIface *self, TnyStreamIface *stream) 
    196250{ 
     251#ifdef DEBUG 
     252        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->decode_to_stream_func) 
     253                g_critical ("You must implement tny_msg_mime_part_iface_decode_to_stream\n"); 
     254#endif 
     255 
    197256        TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->decode_to_stream_func (self, stream); 
    198257        return; 
     
    211270tny_msg_mime_part_iface_construct_from_stream (TnyMsgMimePartIface *self, TnyStreamIface *stream, const gchar *type) 
    212271{ 
     272#ifdef DEBUG 
     273        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->construct_from_stream_func) 
     274                g_critical ("You must implement tny_msg_mime_part_iface_construct_from_stream\n"); 
     275#endif 
     276 
    213277        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->construct_from_stream_func (self, stream, type); 
    214278} 
     
    227291tny_msg_mime_part_iface_get_stream (TnyMsgMimePartIface *self) 
    228292{ 
     293#ifdef DEBUG 
     294        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_stream_func) 
     295                g_critical ("You must implement tny_msg_mime_part_iface_get_stream\n"); 
     296#endif 
     297 
    229298        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_stream_func (self); 
    230299} 
     
    242311tny_msg_mime_part_iface_get_content_type (TnyMsgMimePartIface *self) 
    243312{ 
     313#ifdef DEBUG 
     314        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_type_func) 
     315                g_critical ("You must implement tny_msg_mime_part_iface_get_content_type\n"); 
     316#endif 
     317 
    244318        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->get_content_type_func (self); 
    245319} 
     
    257331tny_msg_mime_part_iface_content_type_is (TnyMsgMimePartIface *self, const gchar *content_type) 
    258332{ 
     333#ifdef DEBUG 
     334        if (!TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->content_type_is_func) 
     335                g_critical ("You must implement tny_msg_mime_part_iface_content_type_is\n"); 
     336#endif 
     337 
    259338        return TNY_MSG_MIME_PART_IFACE_GET_CLASS (self)->content_type_is_func (self, content_type); 
    260339} 
  • trunk/libtinymail/tny-store-account-iface.c

    r458 r522  
    3434tny_store_account_iface_unsubscribe (TnyStoreAccountIface *self, TnyMsgFolderIface *folder) 
    3535{ 
     36#ifdef DEBUG 
     37        if (!TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->unsubscribe_func) 
     38                g_critical ("You must implement tny_store_account_iface_unsubscribe\n"); 
     39#endif 
     40 
    3641        TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->unsubscribe_func (self, folder); 
    3742        return; 
     
    4954tny_store_account_iface_subscribe (TnyStoreAccountIface *self, TnyMsgFolderIface *folder) 
    5055{ 
     56#ifdef DEBUG 
     57        if (!TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->subscribe_func) 
     58                g_critical ("You must implement tny_store_account_iface_subscribe\n"); 
     59#endif 
     60 
    5161        TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->subscribe_func (self, folder); 
    5262        return; 
     
    6575tny_store_account_iface_get_folders (TnyStoreAccountIface *self, TnyStoreAccountFolderType type) 
    6676{ 
     77#ifdef DEBUG 
     78        if (!TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->get_folders_func) 
     79                g_critical ("You must implement tny_store_account_iface_get_folders\n"); 
     80#endif 
     81 
    6782        return TNY_STORE_ACCOUNT_IFACE_GET_CLASS (self)->get_folders_func (self, type); 
    6883} 
  • trunk/libtinymail/tny-stream-iface.c

    r408 r522  
    3636tny_stream_iface_write_to_stream (TnyStreamIface *self, TnyStreamIface *output) 
    3737{ 
     38#ifdef DEBUG 
     39        if (!TNY_STREAM_IFACE_GET_CLASS (self)->write_to_stream_func) 
     40                g_critical ("You must implement tny_stream_iface_write_to_stream\n"); 
     41#endif 
     42 
    3843        return TNY_STREAM_IFACE_GET_CLASS (self)->write_to_stream_func (self, output); 
    3944} 
     
    5358tny_stream_iface_read  (TnyStreamIface *self, char *buffer, size_t n) 
    5459{ 
     60#ifdef DEBUG 
     61        if (!TNY_STREAM_IFACE_GET_CLASS (self)->read_func) 
     62                g_critical ("You must implement tny_stream_iface_read\n"); 
     63#endif 
     64 
    5565        return TNY_STREAM_IFACE_GET_CLASS (self)->read_func (self, buffer, n); 
    5666} 
     
    7080tny_stream_iface_write (TnyStreamIface *self, const char *buffer, size_t n) 
    7181{ 
     82#ifdef DEBUG 
     83        if (!TNY_STREAM_IFACE_GET_CLASS (self)->write_func) 
     84                g_critical ("You must implement tny_stream_iface_write\n"); 
     85#endif 
     86 
    7287        return TNY_STREAM_IFACE_GET_CLASS (self)->write_func (self, buffer, n); 
    7388} 
     
    86101tny_stream_iface_flush (TnyStreamIface *self) 
    87102{ 
     103#ifdef DEBUG 
     104        if (!TNY_STREAM_IFACE_GET_CLASS (self)->flush_func) 
     105                g_critical ("You must implement tny_stream_iface_flush\n"); 
     106#endif 
     107 
    88108        return TNY_STREAM_IFACE_GET_CLASS (self)->flush_func (self); 
    89109} 
     
    100120tny_stream_iface_close (TnyStreamIface *self) 
    101121{ 
     122#ifdef DEBUG 
     123        if (!TNY_STREAM_IFACE_GET_CLASS (self)->close_func) 
     124                g_critical ("You must implement tny_stream_iface_close\n"); 
     125#endif 
     126 
    102127        return TNY_STREAM_IFACE_GET_CLASS (self)->close_func (self); 
    103128} 
     
    115140tny_stream_iface_eos   (TnyStreamIface *self) 
    116141{ 
     142#ifdef DEBUG 
     143        if (!TNY_STREAM_IFACE_GET_CLASS (self)->eos_func) 
     144                g_critical ("You must implement tny_stream_iface_eos\n"); 
     145#endif 
     146 
    117147        return TNY_STREAM_IFACE_GET_CLASS (self)->eos_func (self); 
    118148} 
     
    131161tny_stream_iface_reset (TnyStreamIface *self) 
    132162{ 
     163#ifdef DEBUG 
     164        if (!TNY_STREAM_IFACE_GET_CLASS (self)->reset_func) 
     165                g_critical ("You must implement tny_stream_iface_reset\n"); 
     166#endif 
     167 
    133168        return TNY_STREAM_IFACE_GET_CLASS (self)->reset_func (self); 
    134169} 
  • trunk/libtinymail/tny-transport-account-iface.c

    r379 r522  
    3434tny_transport_account_iface_send (TnyTransportAccountIface *self, TnyMsgIface *msg) 
    3535{ 
     36#ifdef DEBUG 
     37        if (!TNY_TRANSPORT_ACCOUNT_IFACE_GET_CLASS (self)->send_func) 
     38                g_critical ("You must implement tny_transport_account_iface_send\n"); 
     39#endif 
     40 
    3641        TNY_TRANSPORT_ACCOUNT_IFACE_GET_CLASS (self)->send_func (self, msg); 
    3742        return;