photosgallery/inc/glxlogattribute.h
changeset 0 4e91876724a2
child 18 bcb43dc84c44
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Logging macros
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef ATTRIBUTELOG_H_
       
    22 #define ATTRIBUTELOG_H_
       
    23 
       
    24 #include <glxlogger.h>
       
    25 #include <mpxmediageneraldefs.h> // KMPXMediaIdGeneral attributes
       
    26 #include <glxmediacollectioninternaldefs.h> // KGlxMediaIdCollectionInternal
       
    27 #include <glxbackgroundtnmessagedefs.h> // KGlxMessageIdBackgroundThumbnail
       
    28 #include <glxcollectiongeneraldefs.h> // KGlxMediaIdCollectionPluginSpecific
       
    29 #include <glxcollectionmessagedefs.h> // KGlxCollectionMessageSpecific
       
    30 #include <glxfiltergeneraldefs.h>  // KGlxFilterIdGeneral
       
    31 #include <glxmediageneraldefs.h> // KGlxMediaIdGeneral
       
    32 //#include <glxmediastaticitemdefs.h> // KGlxMediaIdStaticItem
       
    33 #include <mpxmediadrmdefs.h> // KMPXMediaIdDrm
       
    34 
       
    35 void LogAttribute(const TDesC8& aText, const TMPXAttribute& aAttribute)
       
    36 	{
       
    37 	TBuf8<0x50> attributeName;
       
    38 	
       
    39 	// KMPXMediaIdGeneral attributes
       
    40 	if (aAttribute == KMPXMediaGeneralType)
       
    41 		{
       
    42 		attributeName.Append(_L8("KMPXMediaGeneralType"));
       
    43 		}
       
    44 	else if (aAttribute == KMPXMediaGeneralCategory)
       
    45 		{
       
    46 		attributeName.Append(_L8("KMPXMediaGeneralCategory"));
       
    47 		}
       
    48 	else if (aAttribute == KMPXMediaGeneralUri)
       
    49 		{
       
    50 		attributeName.Append(_L8("KMPXMediaGeneralUri"));
       
    51 		}
       
    52 	else if (aAttribute == KMPXMediaGeneralDrive)
       
    53 		{
       
    54 		attributeName.Append(_L8("KMPXMediaGeneralDrive"));
       
    55 		}
       
    56 	else if (aAttribute == KMPXMediaGeneralSize)
       
    57 		{
       
    58 		attributeName.Append(_L8("KMPXMediaGeneralSize"));
       
    59 		}
       
    60 	else if (aAttribute == KMPXMediaGeneralDuration)
       
    61 		{
       
    62 		attributeName.Append(_L8("KMPXMediaGeneralDuration"));
       
    63 		}
       
    64 	else if (aAttribute == KMPXMediaGeneralTitle)
       
    65 		{
       
    66 		attributeName.Append(_L8("KMPXMediaGeneralTitle"));
       
    67 		}
       
    68 	else if (aAttribute == KMPXMediaGeneralDate)
       
    69 		{
       
    70 		attributeName.Append(_L8("KMPXMediaGeneralDate"));
       
    71 		}
       
    72 	else if (aAttribute == KMPXMediaGeneralDate)
       
    73 		{
       
    74 		attributeName.Append(_L8("KMPXMediaGeneralDate"));
       
    75 		}
       
    76 	else if (aAttribute == KMPXMediaGeneralComment)
       
    77 		{
       
    78 		attributeName.Append(_L8("KMPXMediaGeneralComment"));
       
    79 		}
       
    80 	else if (aAttribute == KMPXMediaGeneralMimeType)
       
    81 		{
       
    82 		attributeName.Append(_L8("KMPXMediaGeneralMimeType"));
       
    83 		}
       
    84 	else if (aAttribute == KMPXMediaGeneralThumbnail1)
       
    85 		{
       
    86 		attributeName.Append(_L8("KMPXMediaGeneralThumbnail1"));
       
    87 		}
       
    88 	else if (aAttribute == KMPXMediaGeneralThumbnail2)
       
    89 		{
       
    90 		attributeName.Append(_L8("KMPXMediaGeneralThumbnail2"));
       
    91 		}
       
    92 	else if (aAttribute == KMPXMediaGeneralIcon)
       
    93 		{
       
    94 		attributeName.Append(_L8("KMPXMediaGeneralIcon"));
       
    95 		}
       
    96 	else if (aAttribute == KMPXMediaGeneralRemote)
       
    97 		{
       
    98 		attributeName.Append(_L8("KMPXMediaGeneralRemote"));
       
    99 		}
       
   100 	else if (aAttribute == KMPXMediaGeneralSynchronized)
       
   101 		{
       
   102 		attributeName.Append(_L8("KMPXMediaGeneralSynchronized"));
       
   103 		}
       
   104 	else if (aAttribute == KMPXMediaGeneralDeleted)
       
   105 		{
       
   106 		attributeName.Append(_L8("KMPXMediaGeneralDeleted"));
       
   107 		}
       
   108 	else if (aAttribute == KMPXMediaGeneralModified)
       
   109 		{
       
   110 		attributeName.Append(_L8("KMPXMediaGeneralModified"));
       
   111 		}
       
   112 	else if (aAttribute == KMPXMediaGeneralCount)
       
   113 		{
       
   114 		attributeName.Append(_L8("KMPXMediaGeneralCount"));
       
   115 		}
       
   116 	else if (aAttribute == KMPXMediaGeneralId)
       
   117 		{
       
   118 		attributeName.Append(_L8("KMPXMediaGeneralId"));
       
   119 		}
       
   120 	else if (aAttribute == KMPXMediaGeneralCollectionId)
       
   121 		{
       
   122 		attributeName.Append(_L8("KMPXMediaGeneralCollectionId"));
       
   123 		}
       
   124 	else if (aAttribute == KMPXMediaGeneralBrokenLink)
       
   125 		{
       
   126 		attributeName.Append(_L8("KMPXMediaGeneralBrokenLink"));
       
   127 		}
       
   128 	else if (aAttribute == KMPXMediaGeneralNonPermissibleActions)
       
   129 		{
       
   130 		attributeName.Append(_L8("KMPXMediaGeneralNonPermissibleActions"));
       
   131 		}
       
   132 	else if (aAttribute == KMPXMediaGeneralContainerId)
       
   133 		{
       
   134 		attributeName.Append(_L8("KMPXMediaGeneralContainerId"));
       
   135 		}
       
   136 	else if (aAttribute == KMPXMediaGeneralSubTitle)
       
   137 		{
       
   138 		attributeName.Append(_L8("KMPXMediaGeneralSubTitle"));
       
   139 		}
       
   140 	else if (aAttribute == KMPXMediaGeneralCopyright)
       
   141 		{
       
   142 		attributeName.Append(_L8("KMPXMediaGeneralCopyright"));
       
   143 		}
       
   144 	else if (aAttribute == KMPXMediaGeneralFlags)
       
   145 		{
       
   146 		attributeName.Append(_L8("KMPXMediaGeneralFlags"));
       
   147 		}
       
   148 	else if (aAttribute == KMPXMediaGeneralLastPlaybackPosition)
       
   149 		{
       
   150 		attributeName.Append(_L8("KMPXMediaGeneralLastPlaybackPosition"));
       
   151 		}
       
   152 	else if (aAttribute == KMPXMediaGeneralLastPlaybackTime)
       
   153 		{
       
   154 		attributeName.Append(_L8("KMPXMediaGeneralLastPlaybackTime"));
       
   155 		}
       
   156 	else if (aAttribute == KMPXMediaGeneralPlayCount)
       
   157 		{
       
   158 		attributeName.Append(_L8("KMPXMediaGeneralPlayCount"));
       
   159 		}
       
   160 	else if (aAttribute == KMPXMediaGeneralContainerPath)
       
   161 		{
       
   162 		attributeName.Append(_L8("KMPXMediaGeneralContainerPath"));
       
   163 		}
       
   164 	else if (aAttribute == KMPXMediaGeneralPath)
       
   165 		{
       
   166 		attributeName.Append(_L8("KMPXMediaGeneralPath"));
       
   167 		}
       
   168 	else if (aAttribute == KMPXMediaGeneralValue)
       
   169 		{
       
   170 		attributeName.Append(_L8("KMPXMediaGeneralValue"));
       
   171 		}
       
   172 	else if (aAttribute == KMPXMediaGeneralAll)
       
   173 		{
       
   174 		attributeName.Append(_L8("KMPXMediaGeneralAll"));
       
   175 		}	
       
   176 	//  KGlxMediaIdCollectionInternal attributes
       
   177 	else if (aAttribute == KGlxMediaCollectionInternalStartDate)
       
   178 		{
       
   179 		attributeName.Append(_L8("KGlxMediaCollectionInternalStartDate"));
       
   180 		}	
       
   181 	else if (aAttribute == KGlxMediaCollectionInternalEndDate)
       
   182 		{
       
   183 		attributeName.Append(_L8("KGlxMediaCollectionInternalEndDate"));
       
   184 		}
       
   185 	else if (aAttribute == KGlxMediaCollectionInternalUsageCount)
       
   186 		{
       
   187 		attributeName.Append(_L8("KGlxMediaCollectionInternalUsageCount"));
       
   188 		}
       
   189 	else if (aAttribute == KGlxMediaCollectionInternalSystemItemType)
       
   190 		{
       
   191 		attributeName.Append(_L8("KGlxMediaCollectionInternalSystemItemType"));
       
   192 		}
       
   193 	// KGlxMessageIdBackgroundThumbnail attributes
       
   194 	else if (aAttribute == KGlxBackgroundThumbnailMediaId)
       
   195 		{
       
   196 		attributeName.Append(_L8("KGlxBackgroundThumbnailMediaId"));
       
   197 		}
       
   198 	else if (aAttribute == KGlxBackgroundThumbnailSize)
       
   199 		{
       
   200 		attributeName.Append(_L8("KGlxBackgroundThumbnailSize"));
       
   201 		}
       
   202 	else if (aAttribute == KGlxBackgroundThumbnailError)
       
   203 		{
       
   204 		attributeName.Append(_L8("KGlxBackgroundThumbnailError"));
       
   205 		}
       
   206 	// KGlxMediaIdCollectionPluginSpecific attributes
       
   207 	else if (aAttribute == KGlxMediaCollectionPluginSpecificSubTitle)
       
   208 		{
       
   209 		attributeName.Append(_L8("KGlxMediaCollectionPluginSpecificSubTitle"));
       
   210 		}
       
   211 	else if (aAttribute == KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle)
       
   212 		{
       
   213 		attributeName.Append(_L8("KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle"));
       
   214 		}	
       
   215 	else if (aAttribute == KGlxMediaCollectionPluginSpecificNewMediaItemTitle)
       
   216 		{
       
   217 		attributeName.Append(_L8("KGlxMediaCollectionPluginSpecificNewMediaItemTitle"));
       
   218 		}	
       
   219 	else if (aAttribute == KGlxMediaCollectionPluginSpecificDefaultMediaTitle)
       
   220 		{
       
   221 		attributeName.Append(_L8("KGlxMediaCollectionPluginSpecificDefaultMediaTitle"));
       
   222 		}	
       
   223 	// KGlxCollectionMessageSpecific attributes
       
   224 	else if (aAttribute == KGlxCollectionMessageContainerId)
       
   225 		{
       
   226 		attributeName.Append(_L8("KGlxCollectionMessageContainerId"));
       
   227 		}
       
   228 	else if (aAttribute == KGlxCollectionMessageContainerCategory)
       
   229 		{
       
   230 		attributeName.Append(_L8("KGlxCollectionMessageContainerCategory"));
       
   231 		}
       
   232 	else if (aAttribute == KGlxCollectionMessageContainerCameraAlbum)
       
   233 		{
       
   234 		attributeName.Append(_L8("KGlxCollectionMessageContainerCameraAlbum"));
       
   235 		}
       
   236 	// KGlxFilterIdGeneral attributes
       
   237 	else if (aAttribute == KGlxFilterGeneralSortType)
       
   238 		{
       
   239 		attributeName.Append(_L8("KGlxFilterGeneralSortType"));
       
   240 		}
       
   241 	else if (aAttribute == KGlxFilterGeneralSortDirection)
       
   242 		{
       
   243 		attributeName.Append(_L8("KGlxFilterGeneralSortDirection"));
       
   244 		}
       
   245 	else if (aAttribute == KGlxFilterGeneralIncludeCameraAlbum)
       
   246 		{
       
   247 		attributeName.Append(_L8("KGlxFilterGeneralIncludeCameraAlbum"));
       
   248 		}
       
   249 	else if (aAttribute == KGlxFilterGeneralMinCount)
       
   250 		{
       
   251 		attributeName.Append(_L8("KGlxFilterGeneralMinCount"));
       
   252 		}
       
   253 	else if (aAttribute == KGlxFilterGeneralItemId)
       
   254 		{
       
   255 		attributeName.Append(_L8("KGlxFilterGeneralItemId"));
       
   256 		}
       
   257 	else if (aAttribute == KGlxFilterGeneralExcludeAnimation)
       
   258 		{
       
   259 		attributeName.Append(_L8("KGlxFilterGeneralExcludeAnimation"));
       
   260 		}
       
   261 	else if (aAttribute == KGlxFilterGeneralLastCaptureDate)
       
   262 		{
       
   263 		attributeName.Append(_L8("KGlxFilterGeneralLastCaptureDate"));
       
   264 		}
       
   265 	else if (aAttribute == KGlxFilterGeneralThumbnailLoadability)
       
   266 		{
       
   267 		attributeName.Append(_L8("KGlxFilterGeneralThumbnailLoadability"));
       
   268 		}
       
   269 	else if (aAttribute == KGlxFilterGeneralMPXCollectionPath)
       
   270 		{
       
   271 		attributeName.Append(_L8("KGlxFilterGeneralMPXCollectionPath"));
       
   272 		}
       
   273 	else if (aAttribute == KGlxFilterGeneralItemType)
       
   274 		{
       
   275 		attributeName.Append(_L8("KGlxFilterGeneralItemType"));
       
   276 		}
       
   277 	else if (aAttribute == KGlxFilterGeneralUri)
       
   278 		{
       
   279 		attributeName.Append(_L8("KGlxFilterGeneralUri"));
       
   280 		}
       
   281 	else if (aAttribute == KGlxFilterGeneralSortOrderPromoteSystemItems)
       
   282 		{
       
   283 		attributeName.Append(_L8("KGlxFilterGeneralSortOrderPromoteSystemItems"));
       
   284 		}
       
   285 	else if (aAttribute == KGlxFilterGeneralOrigin)
       
   286 		{
       
   287 		attributeName.Append(_L8("KGlxFilterGeneralOrigin"));
       
   288 		}
       
   289 	else if (aAttribute == KGlxFilterGeneralNoDRM)
       
   290 		{
       
   291 		attributeName.Append(_L8("KGlxFilterGeneralNoDRM"));
       
   292 		}
       
   293 	else if (aAttribute == KGlxFilterGeneralNavigationalStateOnly)
       
   294 		{
       
   295 		attributeName.Append(_L8("KGlxFilterGeneralNavigationalStateOnly"));
       
   296 		}
       
   297 	// KGlxMediaIdGeneral attributes
       
   298 	else if (aAttribute == KGlxMediaGeneralSystemItem)
       
   299 		{
       
   300 		attributeName.Append(_L8("KGlxMediaGeneralSystemItem"));
       
   301 		}
       
   302 	else if (aAttribute == KGlxMediaGeneralDimensions)
       
   303 		{
       
   304 		attributeName.Append(_L8("KGlxMediaGeneralDimensions"));
       
   305 		}
       
   306 	else if (aAttribute == KGlxMediaGeneralFramecount)
       
   307 		{
       
   308 		attributeName.Append(_L8("KGlxMediaGeneralFramecount"));
       
   309 		}
       
   310 	else if (aAttribute == KGlxMediaGeneralLocation)
       
   311 		{
       
   312 		attributeName.Append(_L8("KGlxMediaGeneralLocation"));
       
   313 		}
       
   314 	else if (aAttribute == KGlxMediaGeneralSlideshowableContent)
       
   315 		{
       
   316 		attributeName.Append(_L8("KGlxMediaGeneralSlideshowableContent"));
       
   317 		}
       
   318 	else if (aAttribute == KGlxMediaGeneralLastModifiedDate)
       
   319 		{
       
   320 		attributeName.Append(_L8("KGlxMediaGeneralLastModifiedDate"));
       
   321 		}
       
   322 	// KMPXMediaIdDrm attributes
       
   323 	else if (aAttribute == KMPXMediaDrmType)
       
   324 		{
       
   325 		attributeName.Append(_L8("KMPXMediaDrmType"));
       
   326 		}
       
   327 	else if (aAttribute == KMPXMediaDrmProtected)
       
   328 		{
       
   329 		attributeName.Append(_L8("KMPXMediaDrmProtected"));
       
   330 		}
       
   331 	else if (aAttribute == KMPXMediaDrmRightsStatus)
       
   332 		{
       
   333 		attributeName.Append(_L8("KMPXMediaDrmRightsStatus"));
       
   334 		}
       
   335 	else if (aAttribute == KMPXMediaDrmRightsType)
       
   336 		{
       
   337 		attributeName.Append(_L8("KMPXMediaDrmRightsType"));
       
   338 		}
       
   339 	else if (aAttribute == KMPXMediaDrmCount)
       
   340 		{
       
   341 		attributeName.Append(_L8("KMPXMediaDrmCount"));
       
   342 		}
       
   343 	else if (aAttribute == KMPXMediaDrmStartTime)
       
   344 		{
       
   345 		attributeName.Append(_L8("KMPXMediaDrmStartTime"));
       
   346 		}
       
   347 	else if (aAttribute == KMPXMediaDrmEndTime)
       
   348 		{
       
   349 		attributeName.Append(_L8("KMPXMediaDrmEndTime"));
       
   350 		}
       
   351 	else if (aAttribute == KMPXMediaDrmInterval)
       
   352 		{
       
   353 		attributeName.Append(_L8("KMPXMediaDrmInterval"));
       
   354 		}
       
   355 	else if (aAttribute == KMPXMediaDrmIntervalStartTime)
       
   356 		{
       
   357 		attributeName.Append(_L8("KMPXMediaDrmIntervalStartTime"));
       
   358 		}
       
   359 	else if (aAttribute == KMPXMediaDrmAccumulatedTime)
       
   360 		{
       
   361 		attributeName.Append(_L8("KMPXMediaDrmAccumulatedTime"));
       
   362 		}
       
   363 	else if (aAttribute == KMPXMediaDrmSendingAllowed)
       
   364 		{
       
   365 		attributeName.Append(_L8("KMPXMediaDrmSendingAllowed"));
       
   366 		}
       
   367 	else if (aAttribute == KMPXMediaDrmCanSetAutomated)
       
   368 		{
       
   369 		attributeName.Append(_L8("KMPXMediaDrmCanSetAutomated"));
       
   370 		}
       
   371 	else if (aAttribute == KMPXMediaDrmHasInfoUrl)
       
   372 		{
       
   373 		attributeName.Append(_L8("KMPXMediaDrmHasInfoUrl"));
       
   374 		}
       
   375 	else if (aAttribute == KMPXMediaDrmHasPreviewUrl)
       
   376 		{
       
   377 		attributeName.Append(_L8("KMPXMediaDrmHasPreviewUrl"));
       
   378 		}
       
   379 	else if (aAttribute == KMPXMediaDrmAboutToExpire)
       
   380 		{
       
   381 		attributeName.Append(_L8("KMPXMediaDrmAboutToExpire"));
       
   382 		}
       
   383 	else if (aAttribute == KMPXMediaDrmAll)
       
   384 		{
       
   385 		attributeName.Append(_L8("KMPXMediaDrmAll"));
       
   386 		}	
       
   387 	else
       
   388 		{	    
       
   389 		attributeName.AppendFormat(_L8("context id: %d, attribute id %d"), aAttribute.ContentId(), aAttribute.AttributeId());
       
   390 		}
       
   391 	
       
   392 	GlxLogger::WriteFormat(_L8("%S %S"), &aText, &attributeName);
       
   393 	}
       
   394 
       
   395 
       
   396 #endif /*ATTRIBUTELOG_H_*/