Frameworks/libpurple.framework/Versions/0.6.2/Headers/object.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 1739 Frameworks/libpurple.framework/Versions/0.6.0/Headers/object.h@8b0daad9656c
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     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 #include "imgstore.h"
    28 
    29 #include "internal.h"
    30 
    31 typedef enum
    32 {
    33 	MSN_OBJECT_UNKNOWN    = -1, /**< Unknown object        */
    34 	MSN_OBJECT_RESERVED1  =  1, /**< Reserved              */
    35 	MSN_OBJECT_EMOTICON   =  2, /**< Custom Emoticon       */
    36 	MSN_OBJECT_USERTILE   =  3, /**< UserTile (buddy icon) */
    37 	MSN_OBJECT_RESERVED2  =  4, /**< Reserved              */
    38 	MSN_OBJECT_BACKGROUND =  5  /**< Background            */
    39 
    40 } MsnObjectType;
    41 
    42 typedef struct
    43 {
    44 	gboolean local;
    45 
    46 	char *creator;
    47 	int size;
    48 	MsnObjectType type;
    49 	PurpleStoredImage *img;
    50 	char *location;
    51 	char *friendly;
    52 	char *sha1d;
    53 	char *sha1c;
    54 
    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  * Returns a MsnObject's creator value.
   161  *
   162  * @param obj The object.
   163  *
   164  * @return The creator value.
   165  */
   166 const char *msn_object_get_creator(const MsnObject *obj);
   167 
   168 /**
   169  * Returns a MsnObject's size value.
   170  *
   171  * @param obj The object.
   172  *
   173  * @return The size value.
   174  */
   175 int msn_object_get_size(const MsnObject *obj);
   176 
   177 /**
   178  * Returns a MsnObject's type.
   179  *
   180  * @param obj The object.
   181  *
   182  * @return The object type.
   183  */
   184 MsnObjectType msn_object_get_type(const MsnObject *obj);
   185 
   186 /**
   187  * Returns a MsnObject's location value.
   188  *
   189  * @param obj The object.
   190  *
   191  * @return The location value.
   192  */
   193 const char *msn_object_get_location(const MsnObject *obj);
   194 
   195 /**
   196  * Returns a MsnObject's friendly name value.
   197  *
   198  * @param obj The object.
   199  *
   200  * @return The friendly name value.
   201  */
   202 const char *msn_object_get_friendly(const MsnObject *obj);
   203 
   204 /**
   205  * Returns a MsnObject's SHA1D value.
   206  *
   207  * @param obj The object.
   208  *
   209  * @return The SHA1D value.
   210  */
   211 const char *msn_object_get_sha1d(const MsnObject *obj);
   212 
   213 /**
   214  * Returns a MsnObject's SHA1C value.
   215  *
   216  * @param obj The object.
   217  *
   218  * @return The SHA1C value.
   219  */
   220 const char *msn_object_get_sha1c(const MsnObject *obj);
   221 
   222 /**
   223  * Returns a MsnObject's SHA1C value if it exists, otherwise SHA1D.
   224  *
   225  * @param obj The object.
   226  *
   227  * @return The SHA1C value.
   228  */
   229 const char *msn_object_get_sha1(const MsnObject *obj);
   230 
   231 /**
   232  * Returns the image associated with the MsnObject.
   233  *
   234  * @param obj The object.
   235  *
   236  * @return The associated image.
   237  */
   238 PurpleStoredImage *msn_object_get_image(const MsnObject *obj);
   239 
   240 void msn_object_set_local(MsnObject *obj);
   241 
   242 #endif /* _MSN_OBJECT_H_ */