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