~ubuntu-branches/ubuntu/lucid/libmsn/lucid

« back to all changes in this revision

Viewing changes to msn/util.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-01-16 14:26:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090116142647-a3bg7ubnz3n7flmf
Tags: 4.0~beta3-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    U32 _ucs2_utf8(U8 *dst, U8 *src, U32 nchar);
99
99
    U32 _utf8_ucs2(U8 *dst, U8 *src);
100
100
 
 
101
    /** represents a contact pesonal message */
101
102
    typedef struct 
102
103
    {
103
 
         std::string PSM; // personal status message
104
 
         std::string mediaApp; //iTunes, Winamp or keep it empty
105
 
         std::string mediaType; // 'Music', 'Games' or 'Office'
106
 
         bool mediaIsEnabled; // enable/disable the Current Media setting
107
 
         std::string mediaFormat; //for example, "{0} - {1}"
108
 
         std::vector<std::string> mediaLines; // [0] will be {0}, etc..
 
104
         std::string PSM; /**< personal status message */
 
105
         std::string mediaApp; /**< iTunes, Winamp or keep it empty */
 
106
         std::string mediaType; /**<  'Music', 'Games' or 'Office' */
 
107
         bool mediaIsEnabled; /**<  enable/disable the Current Media setting */
 
108
         std::string mediaFormat; /**< for example, "{0} - {1}" */
 
109
         std::vector<std::string> mediaLines; /**<  index 0 will be {0}, etc.. */
109
110
    } personalInfo;
110
111
 
 
112
    /** Represents the lists present on server side */
111
113
    typedef enum
112
114
    {
113
115
        LST_AB = 1,        /**< Address book */
117
119
        LST_PL = 16        /**< Pending */
118
120
    }ContactList;
119
121
 
120
 
    typedef struct 
121
 
    {
122
 
         unsigned int sessionID;
123
 
         std::string username;
124
 
         std::string filename;
125
 
         std::ostringstream preview;
126
 
         bool allowed;
127
 
    } fileTransferData;
128
 
 
129
122
    struct tagMSGRUSRKEY
130
123
    {
131
124
         unsigned int uStructHeaderSize; // 28. Does not count data
141
134
         unsigned char aCipherBytes[72];
142
135
    };
143
136
 
144
 
    // struct for offline messages
 
137
    /** represents an offline message */
145
138
    typedef struct 
146
139
    {
147
 
         std::string from;
148
 
         std::string fromFN;
149
 
         std::string id;
 
140
         std::string from; /**< sender passport */
 
141
         std::string fromFN; /**< sender nickname */
 
142
         std::string id; /**< ID of this offline message */
150
143
    } eachOIM;
151
144
 
152
145
    std::string new_branch();
160
153
    void DoMSNP11Challenge(const char *szChallenge, char *szOutput);
161
154
 
162
155
    // stolen from kopete
 
156
    /** List of possible capabilities for a contact */
163
157
    typedef enum
164
158
    {
165
159
        WindowsMobile = 0x1,
190
184
        MSNC7 = 0x70000000
191
185
    } MSNClientInformationFields;
192
186
 
 
187
    /** Defines the file transfer type */
193
188
    enum fileTransferType
194
189
    {
195
 
        FILE_TRANSFER_WITH_PREVIEW = 0x0,
196
 
        FILE_TRANSFER_WITHOUT_PREVIEW = 0x1,
197
 
        FILE_TRANSFER_BACKGROUND_SHARING = 0x4,
198
 
        FILE_TRANSFER_BACKGROUND_SHARING_CUSTOM = 0xC // it is not a simple jpg file, there is a cab file inside it
 
190
        FILE_TRANSFER_WITH_PREVIEW = 0x0, /**< With preview */
 
191
        FILE_TRANSFER_WITHOUT_PREVIEW = 0x1, /**< Without preview */
 
192
        FILE_TRANSFER_BACKGROUND_SHARING = 0x4, /**< Transfer of a sharing background */
 
193
        // it is not a simple jpg file, there is a cab file inside it
 
194
        FILE_TRANSFER_BACKGROUND_SHARING_CUSTOM = 0xC /**< Custom and not supported by libmsn yet */ 
199
195
    };
200
196
 
 
197
    /** Type of the error when a file transfer fails */
201
198
    enum fileTransferError
202
199
    {
203
 
        FILE_TRANSFER_ERROR_USER_CANCELED,
204
 
        FILE_TRANSFER_ERROR_UNKNOWN
 
200
        FILE_TRANSFER_ERROR_USER_CANCELED, /**< The other user canceled */
 
201
        FILE_TRANSFER_ERROR_UNKNOWN /**< Unknown error */
205
202
    };
206
203
 
207
 
 
 
204
    /** Represents a file transfer request */
208
205
    typedef struct 
209
206
    {
210
 
        int type;                 // 0 = no preview, 1 = has preview, 4 = background sharing
211
 
        unsigned int sessionId;
212
 
        std::string userPassport;
213
 
        std::string filename;     // path to the file
214
 
        std::string friendlyname; // suggested name <- required when sending a file.
215
 
        std::string preview;      // base64 encoded png file.
216
 
        unsigned long long filesize;
 
207
        int type;                 /**< 0 = no preview, 1 = has preview, 4 = background sharing */
 
208
        unsigned int sessionId;   /**< Id of this session */
 
209
        std::string userPassport; /**< passport of the origin or the destination */
 
210
        std::string filename;     /**< name the file to receive, or the path of the file to send */
 
211
        std::string friendlyname; /**< suggested name <- required when sending a file */
 
212
        std::string preview;      /**< base64 encoded 96x96 png file, if applicable */
 
213
        unsigned long long filesize; /**< size of the file to send or receive */
217
214
    } fileTransferInvite;
218
215
}
219
216
#endif