94
|
1 |
/*
|
|
2 |
* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef NW_Image_ImageFactory_h
|
|
20 |
#define NW_Image_ImageFactory_h
|
|
21 |
|
|
22 |
#include "nw_object_core.h"
|
|
23 |
#include "nw_image_abstractimage.h"
|
|
24 |
#include "nwx_buffer.h"
|
|
25 |
#include "nwx_http_header.h"
|
|
26 |
|
|
27 |
#ifdef __cplusplus
|
|
28 |
extern "C" {
|
|
29 |
#endif /* __cplusplus */
|
|
30 |
|
|
31 |
/* ------------------------------------------------------------------------- *
|
|
32 |
forward declarations
|
|
33 |
* ------------------------------------------------------------------------- */
|
|
34 |
typedef struct NW_Image_ImageFactory_Class_s NW_Image_ImageFactory_Class_t;
|
|
35 |
typedef struct NW_Image_ImageFactory_s NW_Image_ImageFactory_t;
|
|
36 |
|
|
37 |
typedef struct NW_Image_ImageFactory_MimeTableEntry_s NW_Image_ImageFactory_MimeTableEntry_t;
|
|
38 |
|
|
39 |
/* ------------------------------------------------------------------------- *
|
|
40 |
method prototypes
|
|
41 |
* ------------------------------------------------------------------------- */
|
|
42 |
typedef
|
|
43 |
NW_Image_AbstractImage_t*
|
|
44 |
(*NW_Image_ImageFactory_CreateImage_t)(const NW_Image_ImageFactory_t* imageFactory,
|
|
45 |
NW_Http_ContentTypeString_t contentTypeString,
|
|
46 |
NW_Buffer_t* imageData);
|
|
47 |
|
|
48 |
|
|
49 |
/* ------------------------------------------------------------------------- *
|
|
50 |
class definition
|
|
51 |
* ------------------------------------------------------------------------- */
|
|
52 |
typedef struct NW_Image_ImageFactory_ClassPart_s {
|
|
53 |
const NW_Image_ImageFactory_MimeTableEntry_t* mimeTable;
|
|
54 |
NW_Uint16 numEntries;
|
|
55 |
NW_Image_ImageFactory_CreateImage_t createImage;
|
|
56 |
} NW_Image_ImageFactory_ClassPart_t;
|
|
57 |
|
|
58 |
struct NW_Image_ImageFactory_Class_s {
|
|
59 |
NW_Object_Core_ClassPart_t NW_Object_Core;
|
|
60 |
NW_Image_ImageFactory_ClassPart_t NW_Image_ImageFactory;
|
|
61 |
};
|
|
62 |
|
|
63 |
/* ------------------------------------------------------------------------- *
|
|
64 |
object definiton
|
|
65 |
* ------------------------------------------------------------------------- */
|
|
66 |
struct NW_Image_ImageFactory_s {
|
|
67 |
NW_Object_Core_t super;
|
|
68 |
};
|
|
69 |
|
|
70 |
/* ------------------------------------------------------------------------- *
|
|
71 |
convenience macros
|
|
72 |
* ------------------------------------------------------------------------- */
|
|
73 |
#define NW_Image_ImageFactory_GetClassPart(_object) \
|
|
74 |
(NW_Object_GetClassPart ((_object), NW_Image_ImageFactory))
|
|
75 |
|
|
76 |
#define NW_Image_ImageFactoryOf(_object) \
|
|
77 |
(NW_Object_Cast ((_object), NW_Image_ImageFactory))
|
|
78 |
|
|
79 |
/* ------------------------------------------------------------------------- *
|
|
80 |
global static data
|
|
81 |
* ------------------------------------------------------------------------- */
|
|
82 |
NW_IMAGE_EXPORT const NW_Image_ImageFactory_Class_t NW_Image_ImageFactory_Class;
|
|
83 |
NW_IMAGE_EXPORT const NW_Image_ImageFactory_t NW_Image_ImageFactory;
|
|
84 |
|
|
85 |
/* ------------------------------------------------------------------------- *
|
|
86 |
public prototypes
|
|
87 |
* ------------------------------------------------------------------------- */
|
|
88 |
|
|
89 |
/* ------------------------------------------------------------------------- *
|
|
90 |
public methods
|
|
91 |
* ------------------------------------------------------------------------- */
|
|
92 |
|
|
93 |
#define NW_Image_ImageFactory_CreateImage(_imageFactory, _contentTypeString, _imageData) \
|
|
94 |
(NW_Object_Invoke ((_imageFactory), NW_Image_ImageFactory, createImage) \
|
|
95 |
((_imageFactory), (_contentTypeString), (_imageData)))
|
|
96 |
|
|
97 |
|
|
98 |
#ifdef __cplusplus
|
|
99 |
} // extern "C" {
|
|
100 |
#endif /* __cplusplus */
|
|
101 |
|
|
102 |
#endif /* NW_Image_ImageFactory_h */
|