photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatadialog.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 13 bcb43dc84c44
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    18 
    18 
    19 #include "glximgvwrmetadatadialog.h"
    19 #include "glximgvwrmetadatadialog.h"
    20 
    20 
    21 //system includes
    21 //system includes
    22 #include <AknUtils.h>                   //for AknUtils
    22 #include <AknUtils.h>                   //for AknUtils
    23 #include <lbsposition.h> 
       
    24 #include <akntitle.h>
    23 #include <akntitle.h>
    25 #include <coeaui.h>
       
    26 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR 
    24 #include <data_caging_path_literals.hrh>// KDC_APP_RESOURCE_DIR 
    27 #include <eikmenub.h>                   // for CEikMenuBar
       
    28 #include <StringLoader.h>
    25 #include <StringLoader.h>
    29 #include <akntoolbar.h>
    26 #include <akntoolbar.h>
    30 #include <glxcommandhandleraddtocontainer.h>         // For CGlxCommandHandlerAddToContainer
       
    31 
    27 
    32 //User includes
    28 //User includes
    33 #include <glxmetadatadialog.rsg>
    29 #include <glxmetadatadialog.rsg>
    34 #include <glxresourceutilities.h>
    30 #include <glxresourceutilities.h>
    35 #include <glxlog.h>
    31 #include <glxlog.h>
    36 #include <glxtracer.h>
    32 #include <glxtracer.h>
    37 #include <glxcollectionpluginall.hrh>
       
    38 #include <glxfilterfactory.h>               // for TGlxFilterFactory
       
    39 #include <glxuiutility.h>
       
    40 #include <glxcommandhandlers.hrh>
    33 #include <glxcommandhandlers.hrh>
    41 #include <hlplch.h>                     // for HlpLauncher
       
    42 #include <photos.hlp.hrh>
       
    43 #include <glxgallery.hrh>
       
    44 #include <glxdetailsboundcommand.hrh>
    34 #include <glxdetailsboundcommand.hrh>
    45 #include <glxscreenfurniture.h>
       
    46 #include <glxuiutilities.rsg>
       
    47 #include <glxpanic.h>                    // For Panics
       
    48 #include "glxmetadatacommandhandler.h"
    35 #include "glxmetadatacommandhandler.h"
    49 
    36 
    50 // ============================ MEMBER FUNCTIONS ===============================
    37 // ============================ MEMBER FUNCTIONS ===============================
    51 
    38 
    52 // -----------------------------------------------------------------------------
    39 // -----------------------------------------------------------------------------
    62     self->ConstructL();
    49     self->ConstructL();
    63     CleanupStack::Pop( self );
    50     CleanupStack::Pop( self );
    64     return self;
    51     return self;
    65     }
    52     }
    66 
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CGlxImgVwrMetadataDialog
       
    56 // -----------------------------------------------------------------------------
       
    57 //
    67 CGlxImgVwrMetadataDialog::CGlxImgVwrMetadataDialog(const TDesC& aUri):iUri(aUri)
    58 CGlxImgVwrMetadataDialog::CGlxImgVwrMetadataDialog(const TDesC& aUri):iUri(aUri)
    68     {
    59     {
    69 
    60     }
    70     }
    61 
    71 // -----------------------------------------------------------------------------
    62 // -----------------------------------------------------------------------------
    72 // ConstructL
    63 // ConstructL
    73 // -----------------------------------------------------------------------------
    64 // -----------------------------------------------------------------------------
    74 //
    65 //
    75 void CGlxImgVwrMetadataDialog::ConstructL()
    66 void CGlxImgVwrMetadataDialog::ConstructL()
    91     if(statusPane && statusPane->IsVisible())
    82     if(statusPane && statusPane->IsVisible())
    92         {
    83         {
    93         iStatusPaneAvailable = ETrue;       
    84         iStatusPaneAvailable = ETrue;       
    94         }
    85         }
    95 
    86 
    96     // make the toolbar disabled
       
    97     SetDetailsDlgToolbarVisibility(EFalse);        
       
    98 
       
    99     // do we have status pane
    87     // do we have status pane
   100     if( statusPane )
    88     if( statusPane )
   101         {
    89         {
   102         GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible());    
    90         GLX_LOG_INFO1("GLX_UMP::CGlxImgVwrMetadataDialog::ConstructL::STATUS PANE = %d",
       
    91                 statusPane->IsVisible());    
   103         // load the title text
    92         // load the title text
   104         HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, iEikonEnv );
    93         HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS, iEikonEnv );
   105         SetTitleL( *text );
    94         SetTitleL( *text );
   106         if( text)
    95         if( text)
   107             {
    96             {
   108             delete text;
    97             delete text;
   109             }
    98             }
   110         iAvkonAppUi->StatusPane()->MakeVisible(ETrue);             
    99         iAvkonAppUi->StatusPane()->MakeVisible(ETrue);             
   111         }
   100         }
   112 
       
   113     iUiUtility = CGlxUiUtility::UtilityL(); 
       
   114 
       
   115     } 
   101     } 
   116 
   102 
   117 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   118 // ~CGlxImgVwrMetadataDialog
   104 // ~CGlxImgVwrMetadataDialog
   119 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   120 //
   106 //
   121 CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog()
   107 CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog()
   122     {
   108     {
   123 
       
   124     TRACER("CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog");
   109     TRACER("CGlxImgVwrMetadataDialog::~CGlxImgVwrMetadataDialog");
   125 
       
   126 
   110 
   127     //To Disable the status pane if the dialog is launched from fullscreenview  
   111     //To Disable the status pane if the dialog is launched from fullscreenview  
   128     if (!iStatusPaneAvailable && iAvkonAppUi)
   112     if (!iStatusPaneAvailable && iAvkonAppUi)
   129         {
   113         {
   130         iAvkonAppUi->StatusPane()->MakeVisible(EFalse);
   114         iAvkonAppUi->StatusPane()->MakeVisible(EFalse);
   141     if (iAvkonAppUi)
   125     if (iAvkonAppUi)
   142         {
   126         {
   143         TRAP_IGNORE(iAvkonAppUi->ProcessCommandL(EGlxCmdResetView));
   127         TRAP_IGNORE(iAvkonAppUi->ProcessCommandL(EGlxCmdResetView));
   144         }
   128         }
   145 
   129 
   146     if( iUiUtility )
       
   147         {
       
   148         iUiUtility->Close();
       
   149         }
       
   150 
       
   151     if (iResourceOffset)
   130     if (iResourceOffset)
   152         {
   131         {
   153         CCoeEnv::Static()->DeleteResourceFile(iResourceOffset);
   132         CCoeEnv::Static()->DeleteResourceFile(iResourceOffset);
   154         }   
   133         }   
   155     }
   134     }
   177 EXPORT_C TInt CGlxImgVwrMetadataDialog::ExecuteLD()
   156 EXPORT_C TInt CGlxImgVwrMetadataDialog::ExecuteLD()
   178     {
   157     {
   179     TRACER("CGlxImgVwrMetadataDialog::ExecuteLD");     
   158     TRACER("CGlxImgVwrMetadataDialog::ExecuteLD");     
   180     return CAknDialog::ExecuteLD( R_IMG_VIEWER_METADATA_DIALOG );
   159     return CAknDialog::ExecuteLD( R_IMG_VIEWER_METADATA_DIALOG );
   181     }
   160     }
       
   161 
   182 // -----------------------------------------------------------------------------
   162 // -----------------------------------------------------------------------------
   183 // ProcessCommandL
   163 // ProcessCommandL
   184 // -----------------------------------------------------------------------------
   164 // -----------------------------------------------------------------------------
   185 //
   165 //
   186 void CGlxImgVwrMetadataDialog::ProcessCommandL( TInt aCommandId )
   166 void CGlxImgVwrMetadataDialog::ProcessCommandL(TInt /*aCommandId*/)
   187     {
   167     {
   188     TRACER("CGlxImgVwrMetadataDialog::ProcessCommandL");
   168     TRACER("CGlxImgVwrMetadataDialog::ProcessCommandL");
   189     // hide menu bar
   169     // hide menu bar
   190     iMenuBar->StopDisplayingMenuBar();
   170     iMenuBar->StopDisplayingMenuBar();
   191     }
   171     }
       
   172 
   192 //-----------------------------------------------------------------------------
   173 //-----------------------------------------------------------------------------
   193 // CGlxImgVwrMetadataDialog::CreateCustomControlL
   174 // CGlxImgVwrMetadataDialog::CreateCustomControlL
   194 //-----------------------------------------------------------------------------
   175 //-----------------------------------------------------------------------------
   195 SEikControlInfo CGlxImgVwrMetadataDialog::CreateCustomControlL(TInt 
   176 SEikControlInfo CGlxImgVwrMetadataDialog::CreateCustomControlL(TInt 
   196         aControlType)
   177         aControlType)
   197     {
   178     {
   198     GLX_LOG_INFO("CShwSlideshowSettingsDialog::CreateCustomControlL");
   179     GLX_LOG_INFO("CGlxImgVwrMetadataDialog::CreateCustomControlL");
   199 
   180 
   200     // create control info, no flags or trailer text set
   181     // create control info, no flags or trailer text set
   201     SEikControlInfo controlInfo;
   182     SEikControlInfo controlInfo;
   202     controlInfo.iControl        = NULL;
   183     controlInfo.iControl = NULL;
   203     controlInfo.iTrailerTextId  = 0;
   184     controlInfo.iTrailerTextId = 0;
   204     controlInfo.iFlags          = 0;
   185     controlInfo.iFlags = 0;
   205     if (aControlType == EMetaDataDialogListBox)
   186     if (aControlType == EMetaDataDialogListBox)
   206         {
   187         {
   207         iContainer = CGlxImgVwrMetadataContainer::NewL(iAvkonAppUi->ClientRect(),iUri);        
   188         iContainer = CGlxImgVwrMetadataContainer::NewL(
       
   189                 iAvkonAppUi->ClientRect(), iUri);
   208         controlInfo.iControl = iContainer; // giving ownership   
   190         controlInfo.iControl = iContainer; // giving ownership   
   209         }
   191         }
   210     return controlInfo; // returns ownership of ItemList
   192     return controlInfo; // returns ownership of ItemList
   211     }
   193     }
   212 
   194 
   213 // -----------------------------------------------------------------------------
       
   214 // CGlxImgVwrMetadataDialog::DynInitMenuPaneL
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 void CGlxImgVwrMetadataDialog::DynInitMenuPaneL(TInt /*aMenuId*/,
       
   218         CEikMenuPane* /*aMenuPane*/)
       
   219     {
       
   220     //no implementation
       
   221     }
       
   222 
       
   223 //-----------------------------------------------------------------------------
       
   224 // CGlxImgVwrMetadataDialog::SizeChanged
       
   225 //-----------------------------------------------------------------------------
       
   226 void CGlxImgVwrMetadataDialog::SizeChanged()
       
   227     {
       
   228     TRACER("CGlxImgVwrMetadataDialog::SizeChanged");
       
   229     CAknDialog::SizeChanged();
       
   230     }
       
   231 // -----------------------------------------------------------------------------
   195 // -----------------------------------------------------------------------------
   232 // CGlxImgVwrMetadataDialog::InitResourceL
   196 // CGlxImgVwrMetadataDialog::InitResourceL
   233 // -----------------------------------------------------------------------------
   197 // -----------------------------------------------------------------------------
   234 //
   198 //
   235 void CGlxImgVwrMetadataDialog::InitResourceL()    
   199 void CGlxImgVwrMetadataDialog::InitResourceL()    
   244     resourceFile.Append(parse.FullName()); 
   208     resourceFile.Append(parse.FullName()); 
   245     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   209     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   246     iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   210     iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   247     }  
   211     }  
   248 
   212 
   249 
       
   250 // -----------------------------------------------------------------------------
       
   251 // CGlxImgVwrMetadataDialog::HandleViewCommandL
       
   252 // -----------------------------------------------------------------------------
       
   253 //    
       
   254 TBool CGlxImgVwrMetadataDialog::HandleViewCommandL( TInt /*aCommand*/ )
       
   255     {
       
   256     TRACER("CGlxImgVwrMetadataDialog::HandleViewCommandL");
       
   257     return EFalse;
       
   258     }
       
   259 // ---------------------------------------------------------------------------
       
   260 // CGlxImgVwrMetadataDialog::PreLayoutDynInitL
       
   261 // ---------------------------------------------------------------------------
       
   262 //
       
   263 void CGlxImgVwrMetadataDialog::PreLayoutDynInitL()
       
   264     {
       
   265     // No Implementation
       
   266     }
       
   267 
       
   268 //-----------------------------------------------------------------------------
       
   269 // CGlxImgVwrMetadataDialog::PostLayoutDynInitL
       
   270 //-----------------------------------------------------------------------------
       
   271 //
       
   272 void CGlxImgVwrMetadataDialog::PostLayoutDynInitL()
       
   273     {}
       
   274 
       
   275 //-----------------------------------------------------------------------------
       
   276 // CGlxImgVwrMetadataDialog::Draw
       
   277 //-----------------------------------------------------------------------------
       
   278 //
       
   279 void CGlxImgVwrMetadataDialog::Draw( const TRect& /*aRect*/ ) const
       
   280 {
       
   281 TRACER("CGlxImgVwrMetadataDialog::Draw");
       
   282 TRect rect;
       
   283 AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
       
   284 
       
   285 // Get the standard graphics context
       
   286 CWindowGc& gc = SystemGc();
       
   287 gc.SetBrushColor(KRgbWhite);
       
   288 gc.DrawRect(rect);
       
   289 }
       
   290 
       
   291 //-----------------------------------------------------------------------------
       
   292 // CGlxImgVwrMetadataDialog::HandlePointerEventL
       
   293 //-----------------------------------------------------------------------------
       
   294 //
       
   295 void CGlxImgVwrMetadataDialog::HandlePointerEventL(
       
   296         const TPointerEvent& aPointerEvent)
       
   297     {
       
   298     TRACER("CGlxImgVwrMetadataDialog::HandlePointerEventL");
       
   299     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   300     }
       
   301 
       
   302 // ---------------------------------------------------------------------------
   213 // ---------------------------------------------------------------------------
   303 // CGlxImgVwrMetadataDialog::SetTitleL()
   214 // CGlxImgVwrMetadataDialog::SetTitleL()
   304 // ---------------------------------------------------------------------------
   215 // ---------------------------------------------------------------------------
   305 void CGlxImgVwrMetadataDialog::SetTitleL(const TDesC& aTitleText)
   216 void CGlxImgVwrMetadataDialog::SetTitleL(const TDesC& aTitleText)
   306     {
   217     {
   307     TRACER("CGlxFetcherContainer::SetTitleL");
   218     TRACER("CGlxImgVwrMetadataDialog::SetTitleL");
   308     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   219     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   309     CleanupStack::PushL(statusPane);
   220     CleanupStack::PushL(statusPane);
   310     // get pointer to the default title pane control
   221     // get pointer to the default title pane control
   311     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   222     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   312             TUid::Uid( EEikStatusPaneUidTitle ));       
   223             TUid::Uid( EEikStatusPaneUidTitle ));       
   326 // ---------------------------------------------------------------------------
   237 // ---------------------------------------------------------------------------
   327 // CGlxImgVwrMetadataDialog::SetPreviousTitleL
   238 // CGlxImgVwrMetadataDialog::SetPreviousTitleL
   328 // ---------------------------------------------------------------------------
   239 // ---------------------------------------------------------------------------
   329 void CGlxImgVwrMetadataDialog::SetPreviousTitleL()
   240 void CGlxImgVwrMetadataDialog::SetPreviousTitleL()
   330     {
   241     {
   331     TRACER("CGlxFetcherContainer::SetPreviousTitleL");
   242     TRACER("CGlxImgVwrMetadataDialog::SetPreviousTitleL");
   332     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   243     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   333     CleanupStack::PushL(prevStatusPane);
   244     CleanupStack::PushL(prevStatusPane);
   334     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   245     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   335             TUid::Uid( EEikStatusPaneUidTitle ));       
   246             TUid::Uid( EEikStatusPaneUidTitle ));       
   336     CleanupStack::PushL(prevTitlePane);
   247     CleanupStack::PushL(prevTitlePane);
   340         prevTitlePane->SetTextL( *iPreviousTitle );
   251         prevTitlePane->SetTextL( *iPreviousTitle );
   341         }
   252         }
   342     CleanupStack::Pop(prevTitlePane);
   253     CleanupStack::Pop(prevTitlePane);
   343     CleanupStack::Pop(prevStatusPane);
   254     CleanupStack::Pop(prevStatusPane);
   344     }
   255     }
   345 // -----------------------------------------------------------------------------
   256 
   346 // CGlxImgVwrMetadataDialog::HandleResourceChange
       
   347 // -----------------------------------------------------------------------------
       
   348 //
       
   349 void CGlxImgVwrMetadataDialog::HandleResourceChange( TInt aType )
       
   350     {
       
   351     TRACER("CGlxImgVwrMetadataDialog::HandleResourceChange");
       
   352     //Handle global resource changes, such as scalable UI or skin events and orientation change (override)
       
   353     CAknDialog::HandleResourceChange( aType );
       
   354     }
       
   355 // -----------------------------------------------------------------------------
   257 // -----------------------------------------------------------------------------
   356 // CGlxImgVwrMetadataDialog::HandleToolbarResetting
   258 // CGlxImgVwrMetadataDialog::HandleToolbarResetting
   357 // -----------------------------------------------------------------------------
   259 // -----------------------------------------------------------------------------
   358 //
   260 //
   359 void CGlxImgVwrMetadataDialog::HandleToolbarResetting(TBool aVisible)
   261 void CGlxImgVwrMetadataDialog::HandleToolbarResetting(TBool aVisible)