calendarui/caleneditor/inc/caleneditor.h
changeset 57 bb2d3e476f29
parent 55 2c54b51f39c4
child 63 a3cb48f6c889
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
     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:
       
    15 * The header file for CalenEditor class.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CALENEDITOR_H
       
    20 #define CALENEDITOR_H
       
    21 
       
    22 // System includes
       
    23 #include <QObject>
       
    24 #include <qglobal.h>
       
    25 #include <hbview.h>
       
    26 
       
    27 // Forward declarations
       
    28 class QFile;
       
    29 class QString;
       
    30 class QDateTime;
       
    31 class AgendaUtil;
       
    32 class AgendaEntry;
       
    33 class CalenEditorPrivate;
       
    34 
       
    35 #ifdef CALENEDITOR_LIB
       
    36 #   define CALENEDITOR_EXPORT Q_DECL_EXPORT
       
    37 #else
       
    38 #   define CALENEDITOR_EXPORT Q_DECL_IMPORT
       
    39 #endif
       
    40 
       
    41 class CalenEditor : public QObject //HbView
       
    42 {
       
    43 	Q_OBJECT
       
    44 
       
    45 public:
       
    46 	enum CreateType{
       
    47 		TypeAppointment = 0,
       
    48 		// TODO: Need to add more types
       
    49 		TypeUnKnown = -1
       
    50 	};
       
    51 	
       
    52 	CALENEDITOR_EXPORT explicit CalenEditor(QObject *parent = 0);
       
    53 	CALENEDITOR_EXPORT explicit CalenEditor(AgendaUtil *agendaUtil, QObject *parent = 0);
       
    54 	CALENEDITOR_EXPORT virtual ~CalenEditor();
       
    55 	CALENEDITOR_EXPORT void edit(const QFile &handle, bool launchCalendar);
       
    56 	CALENEDITOR_EXPORT void edit(AgendaEntry entry, bool launchCalendar);
       
    57 	CALENEDITOR_EXPORT void edit(ulong id, bool launchCalendar);
       
    58 	CALENEDITOR_EXPORT void create(QDateTime newEntryDateTime,
       
    59 	            bool launchCalendar,
       
    60 	            CalenEditor::CreateType type = TypeAppointment);
       
    61 	CALENEDITOR_EXPORT void create(AgendaEntry entry,
       
    62 	            bool launchCalendar,
       
    63 	            CalenEditor::CreateType type = TypeAppointment);
       
    64     /**
       
    65     * This Function saves the entries
       
    66     * should only calls after edit or create function has called 
       
    67     */
       
    68 	CALENEDITOR_EXPORT void saveAndCloseEditor();
       
    69 
       
    70 signals:
       
    71 	void entrySaved();
       
    72 	void dialogClosed();
       
    73 	void calendarLaunchFailed(int error);
       
    74 
       
    75 private:
       
    76 #ifdef TESTCALENEDITOR
       
    77 	friend class TestCalenEditor;
       
    78 #endif
       
    79 	CalenEditorPrivate *d_ptr;
       
    80 	Q_DECLARE_PRIVATE_D(d_ptr, CalenEditor)
       
    81 	Q_DISABLE_COPY(CalenEditor)
       
    82 };
       
    83 
       
    84 #endif // CALENEDITOR_H
       
    85 
       
    86 // End of file	--Don't remove this.