Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/object.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     1 /**
       
     2  * @file object.h MSNObject API
       
     3  *
       
     4  * purple
       
     5  *
       
     6  * Purple is the legal property of its developers, whose names are too numerous
       
     7  * to list here.  Please refer to the COPYRIGHT file distributed with this
       
     8  * source distribution.
       
     9  *
       
    10  * This program is free software; you can redistribute it and/or modify
       
    11  * it under the terms of the GNU General Public License as published by
       
    12  * the Free Software Foundation; either version 2 of the License, or
       
    13  * (at your option) any later version.
       
    14  *
       
    15  * This program is distributed in the hope that it will be useful,
       
    16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    18  * GNU General Public License for more details.
       
    19  *
       
    20  * You should have received a copy of the GNU General Public License
       
    21  * along with this program; if not, write to the Free Software
       
    22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
       
    23  */
       
    24 #ifndef MSN_OBJECT_H
       
    25 #define MSN_OBJECT_H
       
    26 
       
    27 typedef enum
       
    28 {
       
    29 	MSN_OBJECT_UNKNOWN    = -1, /**< Unknown object        */
       
    30 	MSN_OBJECT_RESERVED1  =  1, /**< Reserved              */
       
    31 	MSN_OBJECT_EMOTICON   =  2, /**< Custom Emoticon       */
       
    32 	MSN_OBJECT_USERTILE   =  3, /**< UserTile (buddy icon) */
       
    33 	MSN_OBJECT_RESERVED2  =  4, /**< Reserved              */
       
    34 	MSN_OBJECT_BACKGROUND =  5  /**< Background            */
       
    35 } MsnObjectType;
       
    36 
       
    37 #include "internal.h"
       
    38 
       
    39 #include "imgstore.h"
       
    40 
       
    41 typedef struct
       
    42 {
       
    43 	gboolean local;
       
    44 
       
    45 	char *creator;
       
    46 	int size;
       
    47 	MsnObjectType type;
       
    48 	PurpleStoredImage *img;
       
    49 	char *location;
       
    50 	char *friendly;
       
    51 	char *sha1d;
       
    52 	char *sha1c;
       
    53 	char *url;
       
    54 	char *url1;
       
    55 } MsnObject;
       
    56 
       
    57 /**
       
    58  * Creates a MsnObject structure.
       
    59  *
       
    60  * @return A new MsnObject structure.
       
    61  */
       
    62 MsnObject *msn_object_new(void);
       
    63 
       
    64 /**
       
    65  * Creates a MsnObject structure from a string.
       
    66  *
       
    67  * @param str The string.
       
    68  *
       
    69  * @return The new MsnObject structure.
       
    70  */
       
    71 MsnObject *msn_object_new_from_string(const char *str);
       
    72 
       
    73 /**
       
    74  * Creates a MsnObject structure from a stored image
       
    75  *
       
    76  * @param img		The image associated to object
       
    77  * @param location	The object location as stored in MsnObject
       
    78  * @param creator	The creator of the object
       
    79  * @param type		The type of the object
       
    80  *
       
    81  * @return A new MsnObject structure
       
    82  */
       
    83 MsnObject *msn_object_new_from_image(PurpleStoredImage *img,
       
    84 		const char *location, const char *creator, MsnObjectType type);
       
    85 
       
    86 /**
       
    87  * Destroys an MsnObject structure.
       
    88  *
       
    89  * @param obj The object structure.
       
    90  */
       
    91 void msn_object_destroy(MsnObject *obj);
       
    92 
       
    93 /**
       
    94  * Outputs a string representation of an MsnObject.
       
    95  *
       
    96  * @param obj The object.
       
    97  *
       
    98  * @return The string representation. This must be freed.
       
    99  */
       
   100 char *msn_object_to_string(const MsnObject *obj);
       
   101 
       
   102 /**
       
   103  * Sets the creator field in a MsnObject.
       
   104  *
       
   105  * @param creator The creator value.
       
   106  */
       
   107 void msn_object_set_creator(MsnObject *obj, const char *creator);
       
   108 
       
   109 /**
       
   110  * Sets the size field in a MsnObject.
       
   111  *
       
   112  * @param size The size value.
       
   113  */
       
   114 void msn_object_set_size(MsnObject *obj, int size);
       
   115 
       
   116 /**
       
   117  * Sets the type field in a MsnObject.
       
   118  *
       
   119  * @param type The type value.
       
   120  */
       
   121 void msn_object_set_type(MsnObject *obj, MsnObjectType type);
       
   122 
       
   123 /**
       
   124  * Sets the location field in a MsnObject.
       
   125  *
       
   126  * @param location The location value.
       
   127  */
       
   128 void msn_object_set_location(MsnObject *obj, const char *location);
       
   129 
       
   130 /**
       
   131  * Sets the friendly name field in a MsnObject.
       
   132  *
       
   133  * @param friendly The friendly name value.
       
   134  */
       
   135 void msn_object_set_friendly(MsnObject *obj, const char *friendly);
       
   136 
       
   137 /**
       
   138  * Sets the SHA1D field in a MsnObject.
       
   139  *
       
   140  * @param sha1d The sha1d value.
       
   141  */
       
   142 void msn_object_set_sha1d(MsnObject *obj, const char *sha1d);
       
   143 
       
   144 /**
       
   145  * Sets the SHA1C field in a MsnObject.
       
   146  *
       
   147  * @param sha1c The sha1c value.
       
   148  */
       
   149 void msn_object_set_sha1c(MsnObject *obj, const char *sha1c);
       
   150 
       
   151 /**
       
   152  * Associates an image with a MsnObject.
       
   153  *
       
   154  * @param obj The object.
       
   155  * @param img The image to associate.
       
   156  */
       
   157 void msn_object_set_image(MsnObject *obj, PurpleStoredImage *img);
       
   158 
       
   159 /**
       
   160  * Sets the url field in a MsnObject.
       
   161  *
       
   162  * @param url The url value.
       
   163  */
       
   164 void msn_object_set_url(MsnObject *obj, const char *url);
       
   165 
       
   166 /**
       
   167  * Sets the url1 field in a MsnObject.
       
   168  *
       
   169  * @param url1 The url1 value.
       
   170  */
       
   171 void msn_object_set_url1(MsnObject *obj, const char *url);
       
   172 
       
   173 /**
       
   174  * Returns a MsnObject's creator value.
       
   175  *
       
   176  * @param obj The object.
       
   177  *
       
   178  * @return The creator value.
       
   179  */
       
   180 const char *msn_object_get_creator(const MsnObject *obj);
       
   181 
       
   182 /**
       
   183  * Returns a MsnObject's size value.
       
   184  *
       
   185  * @param obj The object.
       
   186  *
       
   187  * @return The size value.
       
   188  */
       
   189 int msn_object_get_size(const MsnObject *obj);
       
   190 
       
   191 /**
       
   192  * Returns a MsnObject's type.
       
   193  *
       
   194  * @param obj The object.
       
   195  *
       
   196  * @return The object type.
       
   197  */
       
   198 MsnObjectType msn_object_get_type(const MsnObject *obj);
       
   199 
       
   200 /**
       
   201  * Returns a MsnObject's location value.
       
   202  *
       
   203  * @param obj The object.
       
   204  *
       
   205  * @return The location value.
       
   206  */
       
   207 const char *msn_object_get_location(const MsnObject *obj);
       
   208 
       
   209 /**
       
   210  * Returns a MsnObject's friendly name value.
       
   211  *
       
   212  * @param obj The object.
       
   213  *
       
   214  * @return The friendly name value.
       
   215  */
       
   216 const char *msn_object_get_friendly(const MsnObject *obj);
       
   217 
       
   218 /**
       
   219  * Returns a MsnObject's SHA1D value.
       
   220  *
       
   221  * @param obj The object.
       
   222  *
       
   223  * @return The SHA1D value.
       
   224  */
       
   225 const char *msn_object_get_sha1d(const MsnObject *obj);
       
   226 
       
   227 /**
       
   228  * Returns a MsnObject's SHA1C value.
       
   229  *
       
   230  * @param obj The object.
       
   231  *
       
   232  * @return The SHA1C value.
       
   233  */
       
   234 const char *msn_object_get_sha1c(const MsnObject *obj);
       
   235 
       
   236 /**
       
   237  * Returns a MsnObject's SHA1C value if it exists, otherwise SHA1D.
       
   238  *
       
   239  * @param obj The object.
       
   240  *
       
   241  * @return The SHA1C value.
       
   242  */
       
   243 const char *msn_object_get_sha1(const MsnObject *obj);
       
   244 
       
   245 /**
       
   246  * Returns the image associated with the MsnObject.
       
   247  *
       
   248  * @param obj The object.
       
   249  *
       
   250  * @return The associated image.
       
   251  */
       
   252 PurpleStoredImage *msn_object_get_image(const MsnObject *obj);
       
   253 
       
   254 /**
       
   255  * Returns a MsnObject's url value.
       
   256  *
       
   257  * @param obj The object.
       
   258  *
       
   259  * @return The url value.
       
   260  */
       
   261 const char *msn_object_get_url(const MsnObject *obj);
       
   262 
       
   263 /**
       
   264  * Returns a MsnObject's url1 value.
       
   265  *
       
   266  * @param obj The object.
       
   267  *
       
   268  * @return The url1 value.
       
   269  */
       
   270 const char *msn_object_get_url1(const MsnObject *obj);
       
   271 
       
   272 MsnObject * msn_object_find_local(const char *sha1);
       
   273 
       
   274 void msn_object_set_local(MsnObject *obj);
       
   275 
       
   276 #endif /* MSN_OBJECT_H */