|
1 /* |
|
2 * Copyright (c) 2009 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: A class for creating country and city tags for media files. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_TAGCREATOR_H |
|
20 #define C_TAGCREATOR_H |
|
21 |
|
22 #include "mdesession.h" |
|
23 #include "mdenamespacedef.h" |
|
24 #include <mdeconstants.h> |
|
25 |
|
26 /** |
|
27 * |
|
28 * @since S60 9.2 |
|
29 */ |
|
30 class CTagCreator : public CBase |
|
31 { |
|
32 public: |
|
33 /** |
|
34 * 2-phased constructor. |
|
35 */ |
|
36 IMPORT_C static CTagCreator* NewL( ); |
|
37 |
|
38 /** |
|
39 * C++ destructor. |
|
40 */ |
|
41 IMPORT_C virtual ~CTagCreator(); |
|
42 |
|
43 /** |
|
44 * Attach country and city tags to an image file/object. |
|
45 * @param aObjectId, object Id for image/video to be tagged. |
|
46 * @param aCountryTagId, a country tag Id. |
|
47 * @param aCityTagId, a city tag Id. |
|
48 * @return None. |
|
49 */ |
|
50 IMPORT_C void AttachTagsL( const TUint32 aObjectId, const TItemId aCountryTagId, |
|
51 const TItemId aCityTagId ); |
|
52 /** |
|
53 * Creates country and city tags. |
|
54 * @param aCountry, a country name. |
|
55 * @param aCountryTagId, reference to a country tag Id. |
|
56 * @param aCity, a city name. |
|
57 * @param aCityTagId, a reference to a city tag Id. |
|
58 * @return None. |
|
59 */ |
|
60 IMPORT_C void CreateLocationTagsL( const TPtrC& aCountry, TItemId& aCountryTagId, |
|
61 const TPtrC& aCity, TItemId& aCityTagId ); |
|
62 |
|
63 /** |
|
64 * Sets the CMdESession for tag creation |
|
65 * @param aSession the CMdESession object |
|
66 */ |
|
67 IMPORT_C void SetSession( CMdESession* aSession ); |
|
68 |
|
69 public: |
|
70 |
|
71 /** |
|
72 * Creates a tag for the country |
|
73 * @param aCountry country name |
|
74 * @param aCity city name |
|
75 * @param aCountryTagId The country tag Id |
|
76 */ |
|
77 void CreateTagForCountryL( const TPtrC& aCountry, |
|
78 TItemId& aCountryTagId ); |
|
79 |
|
80 /** |
|
81 * Creates a tag for the city |
|
82 * @param aCountry The country name |
|
83 * @param aCity The city name |
|
84 * @param aCityTagId The city tag Id |
|
85 */ |
|
86 void CreateTagForCityL( const TPtrC& aCountry, const TPtrC& aCity, TItemId& aCityTagId); |
|
87 |
|
88 private: |
|
89 /** |
|
90 * C++ constructor. |
|
91 */ |
|
92 CTagCreator( ); |
|
93 |
|
94 /** |
|
95 * 2nd phase constructor. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 /** |
|
100 * Creates a tag object and adds it to the database |
|
101 * @param aTitle The title associated with the tag |
|
102 * @param aUri The uri associated with the tag |
|
103 * @return The itemId of the newly created tag in the database |
|
104 */ |
|
105 TUint32 CreateTagL( const TPtrC& aTitle, |
|
106 const TPtrC& aUri, |
|
107 MdeConstants::Tag::TTagType aTagType ); |
|
108 /** |
|
109 * Finds if a tag with the given uri exists |
|
110 * @param aUri The uri by which the tag is to be searched |
|
111 * @return The ItemId of the tag if it exists,0 otherwise |
|
112 */ |
|
113 |
|
114 TUint32 TagExistsL( const TPtrC& aUri ); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * iMdeSession |
|
120 * an instance of the CMdESession |
|
121 */ |
|
122 CMdESession* iMdeSession; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // C_TAGCREATOR_H |
|
127 |
|
128 // End of file. |