|
1 /* |
|
2 * Copyright (c) 2006-2007 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 "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: The model of the CSrchUiServiceContainer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef C_SRCHUI_MODEL_H |
|
23 #define C_SRCHUI_MODEL_H |
|
24 |
|
25 //System Includes |
|
26 #include <bamdesca.h> |
|
27 |
|
28 //User Includes |
|
29 #include "srchui.hrh" |
|
30 |
|
31 //Forward Declarations |
|
32 class CSearchDocument; |
|
33 class CSrchUiGeneral; |
|
34 |
|
35 #define KSearchContentTypeNameMaxLength 50; |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * Adapts the model data for CSrchUiServiceContainer. |
|
41 * |
|
42 * @lib srchuigenui.lib |
|
43 */ |
|
44 NONSHARABLE_CLASS( CSrchUiModel ) : public CBase, public MDesCArray |
|
45 { |
|
46 public: // Symbian Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Symbian OS 2 phased constructor. |
|
50 * |
|
51 * @param aGenSrchUi Search UI. |
|
52 * @return A pointer to the created instance of CSearchResultModel. |
|
53 */ |
|
54 static CSrchUiModel* NewL(CSrchUiGeneral* aGenSrchUi); |
|
55 |
|
56 /** |
|
57 * Symbian OS 2 phased constructor |
|
58 * |
|
59 * @param aGenSrchUi Search UI. |
|
60 * @return A pointer to the created instance of CSearchResultModel. |
|
61 */ |
|
62 static CSrchUiModel* NewLC(CSrchUiGeneral* aGenSrchUi); |
|
63 |
|
64 /** |
|
65 * Standard Destructor. |
|
66 */ |
|
67 ~CSrchUiModel(); |
|
68 |
|
69 public: // Functions from base classes |
|
70 |
|
71 /** |
|
72 * From MDesCArray. |
|
73 * Returns the number of descriptor elements in the array. |
|
74 */ |
|
75 TInt MdcaCount() const; |
|
76 |
|
77 /** |
|
78 * From MDesCArray. |
|
79 * |
|
80 * @param aIndex index of the descriptor element. |
|
81 * Returns a non-modifiable pointer descriptor representing the |
|
82 * descriptor element located at position aIndex within the array. |
|
83 */ |
|
84 TPtrC16 MdcaPoint( TInt aIndex ) const; |
|
85 |
|
86 private: // More constructors |
|
87 |
|
88 /** |
|
89 * @param aIndex index of the descriptor element. |
|
90 * Returns a non-modifiable pointer descriptor representing the |
|
91 * descriptor element located at position aIndex within the array. |
|
92 */ |
|
93 |
|
94 TPtrC16 MdcaPointL( TInt aIndex ) const; |
|
95 |
|
96 /** |
|
97 * Performs the first phase of two phase construction. |
|
98 */ |
|
99 CSrchUiModel(); |
|
100 |
|
101 /** |
|
102 * Performs the second phase construction. |
|
103 * @param aGenSrchUi Search UI. |
|
104 */ |
|
105 void ConstructL(CSrchUiGeneral* aGenSrchUi); |
|
106 |
|
107 private: // Data |
|
108 |
|
109 /* Buffer used for making correct string format needed by listbox items. |
|
110 * mutable because the method is const and the member variable must be modifiable. |
|
111 * own. |
|
112 */ |
|
113 HBufC* iBuffer; |
|
114 |
|
115 /* Caption text for the "all in device" selection |
|
116 * |
|
117 * own. |
|
118 */ |
|
119 HBufC* iAllInDeviceCaption; |
|
120 |
|
121 /* Pointer to general search ui |
|
122 * |
|
123 * not own. |
|
124 */ |
|
125 CSrchUiGeneral* iGenSrchUi; |
|
126 }; |
|
127 #endif // C_SRCHUI_MODEL_H |
|
128 |
|
129 // End of File |