calendarui/controller/src/calendocloader.cpp
changeset 58 ef813d54df51
parent 50 579cc610882e
child 68 a5a1242fd2e8
equal deleted inserted replaced
50:579cc610882e 58:ef813d54df51
    13 *
    13 *
    14 * Description:  Definition file for class CalenDocLoader.
    14 * Description:  Definition file for class CalenDocLoader.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
       
    18 // System includes
       
    19 #include <HbGroupBox>
    18 
    20 
    19 // User includes
    21 // User includes
    20 #include "calendocloader.h"
    22 #include "calendocloader.h"
    21 #include "calenagendaview.h"
    23 #include "calenagendaview.h"
    22 #include "calenagendaviewwidget.h"
    24 #include "calenagendaviewwidget.h"
    25 #include "calenpreviewpane.h"
    27 #include "calenpreviewpane.h"
    26 #include "calencontroller.h"
    28 #include "calencontroller.h"
    27 #include "calenthicklinesdrawer.h"
    29 #include "calenthicklinesdrawer.h"
    28 #include "calencommon.h"
    30 #include "calencommon.h"
    29 #include "calenpluginlabel.h"
    31 #include "calenpluginlabel.h"
       
    32 #include "calendayview.h"
       
    33 #include "calendayhourscrollarea.h"
       
    34 #include "calendaycontentscrollarea.h"
       
    35 #include "OstTraceDefinitions.h"
       
    36 #ifdef OST_TRACE_COMPILER_IN_USE
       
    37 #include "calendocloaderTraces.h"
       
    38 #endif
    30 
    39 
    31 // ----------------------------------------------------------------------------
    40 // ----------------------------------------------------------------------------
    32 // CalenDocLoader::CalenDocLoader
    41 // CalenDocLoader::CalenDocLoader
    33 // C++ default Constructor.
    42 // C++ default Constructor.
    34 // (other items were commented in a header).
    43 // (other items were commented in a header).
    35 // ----------------------------------------------------------------------------
    44 // ----------------------------------------------------------------------------
    36 //
    45 //
    37 CalenDocLoader::CalenDocLoader(CCalenController &controller) :
    46 CalenDocLoader::CalenDocLoader(CCalenController &controller) :
    38 	mController(controller)
    47 	mController(controller)
    39 	{
    48 	{
       
    49     OstTraceFunctionEntry0( CALENDOCLOADER_CALENDOCLOADER_ENTRY );
       
    50     
    40 
    51 
       
    52 	OstTraceFunctionExit0( CALENDOCLOADER_CALENDOCLOADER_EXIT );
    41 	}
    53 	}
    42 
    54 
    43 // ----------------------------------------------------------------------------
    55 // ----------------------------------------------------------------------------
    44 // CalenDocLoader::CalenDocLoader
    56 // CalenDocLoader::CalenDocLoader
    45 // C++ default Destructor.
    57 // C++ default Destructor.
    46 // ----------------------------------------------------------------------------
    58 // ----------------------------------------------------------------------------
    47 //
    59 //
    48 CalenDocLoader::~CalenDocLoader()
    60 CalenDocLoader::~CalenDocLoader()
    49 {
    61 {
       
    62     OstTraceFunctionEntry0( DUP1_CALENDOCLOADER_CALENDOCLOADER_ENTRY );
       
    63     
    50 
    64 
       
    65     OstTraceFunctionExit0( DUP1_CALENDOCLOADER_CALENDOCLOADER_EXIT );
    51 }
    66 }
    52 // ----------------------------------------------------------------------------
    67 // ----------------------------------------------------------------------------
    53 // CalenDocLoader::createObject
    68 // CalenDocLoader::createObject
    54 // @brief From HbDocumentLoader
    69 // @brief From HbDocumentLoader
    55 // Called whenever the docml file is parsed to create objects.
    70 // Called whenever the docml file is parsed to create objects.
    60 // ----------------------------------------------------------------------------
    75 // ----------------------------------------------------------------------------
    61 //
    76 //
    62 QObject *CalenDocLoader::createObject(const QString &type,
    77 QObject *CalenDocLoader::createObject(const QString &type,
    63                                              const QString &name)
    78                                              const QString &name)
    64 {
    79 {
       
    80     OstTraceFunctionEntry0( CALENDOCLOADER_CREATEOBJECT_ENTRY );
       
    81     
    65     MCalenServices &services = mController.Services(); 
    82     MCalenServices &services = mController.Services(); 
    66 	if (name == QString(CALEN_AGENDAVIEW)) {
    83 	if (name == QString(CALEN_AGENDAVIEW)) {
    67 		QObject *calenAgendaView = new CalenAgendaView(services);
    84 		QObject *calenAgendaView = new CalenAgendaView(services);
    68 		calenAgendaView->setObjectName(name);
    85 		calenAgendaView->setObjectName(name);
       
    86 		OstTraceFunctionExit0( CALENDOCLOADER_CREATEOBJECT_EXIT );
    69 		return calenAgendaView;
    87 		return calenAgendaView;
    70 	} else if (name == QString(CALEN_AGENDAVIEW_WIDGET)) {
    88 	} else if (name == QString(CALEN_AGENDAVIEW_WIDGET)) {
    71 	    QObject *calenAgendaViewWidget = new CalenAgendaViewWidget(services, this);
    89 	    QObject *calenAgendaViewWidget = new CalenAgendaViewWidget(services, this);
    72 	    calenAgendaViewWidget->setObjectName(name);
    90 	    calenAgendaViewWidget->setObjectName(name);
       
    91 	    OstTraceFunctionExit0( DUP1_CALENDOCLOADER_CREATEOBJECT_EXIT );
    73 	    return calenAgendaViewWidget;
    92 	    return calenAgendaViewWidget;
    74 	} else if (name == QString(CALEN_MONTHVIEW)) { // For Month View
    93 	} else if (name == QString(CALEN_MONTHVIEW)) { // For Month View
    75         QObject *calenMonthView = new CalenMonthView(services);
    94         QObject *calenMonthView = new CalenMonthView(services);
    76         calenMonthView->setObjectName(name);
    95         calenMonthView->setObjectName(name);
       
    96         OstTraceFunctionExit0( DUP2_CALENDOCLOADER_CREATEOBJECT_EXIT );
    77         return calenMonthView;
    97         return calenMonthView;
    78 	} else if (name == QString(CALEN_MONTHGRID)) {
    98 	} else if (name == QString(CALEN_MONTHGRID)) {
    79         QObject *calenMonthGrid = new CalenMonthGrid();
    99         QObject *calenMonthGrid = new CalenMonthGrid();
    80         calenMonthGrid->setObjectName(name);
   100         calenMonthGrid->setObjectName(name);
       
   101         OstTraceFunctionExit0( DUP3_CALENDOCLOADER_CREATEOBJECT_EXIT );
    81         return calenMonthGrid;
   102         return calenMonthGrid;
    82 	} else if(name == QString(CALEN_PREVPREVIEWPANE)) {
   103 	} else if(name == QString(CALEN_PREVPREVIEWPANE)) {
    83         QObject *prevPreviewPane =
   104         QObject *prevPreviewPane =
    84         new CalenPreviewPane(services);
   105         new CalenPreviewPane(services);
    85         prevPreviewPane->setObjectName(name);
   106         prevPreviewPane->setObjectName(name);
       
   107         OstTraceFunctionExit0( DUP4_CALENDOCLOADER_CREATEOBJECT_EXIT );
    86         return prevPreviewPane;
   108         return prevPreviewPane;
    87     } else if(name == QString(CALEN_CURRPREVIEWPANE)) {
   109     } else if(name == QString(CALEN_CURRPREVIEWPANE)) {
    88         QObject *currPreviewPane =
   110         QObject *currPreviewPane =
    89         new CalenPreviewPane(services);
   111         new CalenPreviewPane(services);
    90         currPreviewPane->setObjectName(name);
   112         currPreviewPane->setObjectName(name);
       
   113         OstTraceFunctionExit0( DUP5_CALENDOCLOADER_CREATEOBJECT_EXIT );
    91         return currPreviewPane;
   114         return currPreviewPane;
    92     } else if(name == QString(CALEN_NEXTPREVIEWPANE)) {
   115     } else if(name == QString(CALEN_NEXTPREVIEWPANE)) {
    93         QObject *nextPreviewPane =
   116         QObject *nextPreviewPane =
    94         new CalenPreviewPane(services);
   117         new CalenPreviewPane(services);
    95         nextPreviewPane->setObjectName(name);
   118         nextPreviewPane->setObjectName(name);
       
   119         OstTraceFunctionExit0( DUP6_CALENDOCLOADER_CREATEOBJECT_EXIT );
    96         return nextPreviewPane;
   120         return nextPreviewPane;
    97     } else if (name == QString(CALEN_DAYNAMES_WIDGET)) {
   121     } else if (name == QString(CALEN_DAYNAMES_WIDGET)) {
    98 	    QObject *calenDayNamesWidget = 
   122 	    QObject *calenDayNamesWidget = 
    99         new CalenThickLinesDrawer(CalendarNamespace::CalenDayNameWidget);
   123         new CalenThickLinesDrawer(CalendarNamespace::CalenDayNameWidget);
   100 	    calenDayNamesWidget->setObjectName(name);
   124 	    calenDayNamesWidget->setObjectName(name);
       
   125 	    OstTraceFunctionExit0( DUP7_CALENDOCLOADER_CREATEOBJECT_EXIT );
   101 	    return calenDayNamesWidget;
   126 	    return calenDayNamesWidget;
   102 	} else if (name == QString(CALEN_WEEKNUMBERS_WIDGET)) {
   127 	} else if (name == QString(CALEN_WEEKNUMBERS_WIDGET)) {
   103 	    QObject *calenSWeekNumWidget =
   128 	    QObject *calenSWeekNumWidget =
   104         new CalenThickLinesDrawer(CalendarNamespace::CalenWeekNumWidget);
   129         new CalenThickLinesDrawer(CalendarNamespace::CalenWeekNumWidget);
   105 	    calenSWeekNumWidget->setObjectName(name);
   130 	    calenSWeekNumWidget->setObjectName(name);
       
   131 	    OstTraceFunctionExit0( DUP8_CALENDOCLOADER_CREATEOBJECT_EXIT );
   106 	    return calenSWeekNumWidget;
   132 	    return calenSWeekNumWidget;
   107 	} else if (name == QString(CALEN_PREVREGIONALINFO)) {
   133 	} else if (name == QString(CALEN_PREVREGIONALINFO)) {
   108 		QObject *calenPrevRegionalLabel = new CalenPluginLabel(services);
   134 		QObject *calenPrevRegionalLabel = new CalenPluginLabel(services);
   109 		calenPrevRegionalLabel->setObjectName(name);
   135 		calenPrevRegionalLabel->setObjectName(name);
       
   136 		OstTraceFunctionExit0( DUP9_CALENDOCLOADER_CREATEOBJECT_EXIT );
   110 		return calenPrevRegionalLabel;
   137 		return calenPrevRegionalLabel;
   111 	} else if (name == QString(CALEN_CURRREGIONALINFO)) {
   138 	} else if (name == QString(CALEN_CURRREGIONALINFO)) {
   112 		QObject *calencurrRegionalLabel = new CalenPluginLabel(services);
   139 		QObject *calencurrRegionalLabel = new CalenPluginLabel(services);
   113 		calencurrRegionalLabel->setObjectName(name);
   140 		calencurrRegionalLabel->setObjectName(name);
       
   141 		OstTraceFunctionExit0( DUP10_CALENDOCLOADER_CREATEOBJECT_EXIT );
   114 		return calencurrRegionalLabel;
   142 		return calencurrRegionalLabel;
   115 	} else if (name == QString(CALEN_NEXTREGIONALINFO)) {
   143 	} else if (name == QString(CALEN_NEXTREGIONALINFO)) {
   116 		QObject *calenNextRegionalLabel = new CalenPluginLabel(services);
   144 		QObject *calenNextRegionalLabel = new CalenPluginLabel(services);
   117 		calenNextRegionalLabel->setObjectName(name);
   145 		calenNextRegionalLabel->setObjectName(name);
       
   146 		OstTraceFunctionExit0( DUP11_CALENDOCLOADER_CREATEOBJECT_EXIT );
   118 		return calenNextRegionalLabel;
   147 		return calenNextRegionalLabel;
       
   148 	} else if (name == QString(CALEN_DAYVIEW)) {
       
   149         QObject *calenDayView = new CalenDayView(services);
       
   150         calenDayView->setObjectName(name);
       
   151         return calenDayView;
       
   152 	} else if (name == QString(CALEN_DAYVIEW_DAYINFO)) {
       
   153 	        QObject *calenDayInfo = new HbGroupBox();
       
   154 	        calenDayInfo->setObjectName(name);
       
   155 	        return calenDayInfo;
       
   156 	} else if (name == QString(CALEN_DAYVIEW_REGIONALINFO)) {
       
   157         QObject *calenRegionalInfo = new HbGroupBox();
       
   158         calenRegionalInfo->setObjectName(name);
       
   159         return calenRegionalInfo;
       
   160     } else if (name == QString(CALEN_DAYVIEW_CONTENTWIDGET)) {
       
   161         QObject *calenContentWidget = new HbWidget();
       
   162         calenContentWidget->setObjectName(name);
       
   163         return calenContentWidget;
       
   164     } else if (name == QString(CALEN_DAYVIEW_HOURSCROLLAREA)) {
       
   165             QObject *hourScrollArea = new CalenDayHourScrollArea();
       
   166             hourScrollArea->setObjectName(name);
       
   167             return hourScrollArea;
       
   168     } else if (name == QString(CALEN_DAYVIEW_CONTENTSCROLLAREA)) {
       
   169             QObject *contentScrollArea = new CalenDayContentScrollArea();
       
   170             contentScrollArea->setObjectName(name);
       
   171             return contentScrollArea;
   119 	} else {
   172 	} else {
       
   173         OstTraceFunctionExit0( DUP12_CALENDOCLOADER_CREATEOBJECT_EXIT );
   120 		return HbDocumentLoader::createObject(type, name);
   174 		return HbDocumentLoader::createObject(type, name);
   121 	}
   175 	}
   122 }
   176 }
   123 
   177 
   124 // End of file	--Don't remove this.
   178 // End of file	--Don't remove this.