emailservices/nmregister/inc/nmmailboxregisterinterface.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     1 /*
       
     2 * Copyright (c) 2010 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: NMail application mailbox registration.
       
    15 *              Adds mailbox to application library and to KQTI HS (as a widget)
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef NMMAILBOXREGISTERINTERFACE_H_
       
    20 #define NMMAILBOXREGISTERINTERFACE_H_
       
    21 
       
    22 //  INCLUDES
       
    23 #include <QObject>
       
    24 #include <qmobilityglobal.h>
       
    25 #include <QVariant>
       
    26 
       
    27 class NmMailboxRegisterInterfacePrivate;
       
    28 
       
    29 class NmMailboxRegisterInterface : public QObject
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34     explicit NmMailboxRegisterInterface(QObject *parent = 0);
       
    35     ~NmMailboxRegisterInterface();
       
    36     
       
    37 public slots:
       
    38     /*!
       
    39     \fn bool registerNewMailbox(quint64 accountId, QString accountName, QString accountIconName)
       
    40     \param accountId The ID of the mailbox to register
       
    41     \param accountName The name of the mailbox to register
       
    42     \param accountIconName The icon name of the mailbox to register 
       
    43     \return true if mailbox registration succeed. false if failed.
       
    44 
       
    45     This method registers mailbox to application library and to homescreen as an email widget.
       
    46 
       
    47     Usage example:
       
    48 
       
    49     QServiceManager manager;    
       
    50     QServiceFilter filter("com.nokia.symbian.IEmailRegisterAccount");
       
    51     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
       
    52     QObject *widgetObject = manager.loadInterface(interfaces.first());
       
    53     
       
    54     QMetaObject::invokeMethod(widgetObject,
       
    55             "registerNewMailbox",
       
    56             Q_ARG(quint64, accountId),
       
    57             Q_ARG(QString, accountName),
       
    58             Q_ARG(QString, "qtg_large_email"));
       
    59      */
       
    60     bool registerNewMailbox(quint64 accountId, QString accountName, QString accountIconName);
       
    61     
       
    62     /*!
       
    63     \fn bool updateMailboxName (quint64 accountId, QString newName)
       
    64     \param accountId The ID of the mailbox to register
       
    65     \param accountName The name of the mailbox to register
       
    66     \return true if mailbox name updated succesfully. false if failed.
       
    67 
       
    68     This method updates mailbox name to application library.
       
    69 
       
    70     Usage example:
       
    71 
       
    72     QServiceManager manager;   
       
    73     QServiceFilter filter("com.nokia.symbian.IEmailRegisterAccount");
       
    74     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
       
    75     QObject *widgetObject = manager.loadInterface(interfaces.first());
       
    76      
       
    77     QMetaObject::invoke(widgetObject,
       
    78             "updateMailboxName",
       
    79             Q_ARG(quint64, accountId),
       
    80             Q_ARG(QString, accountName));
       
    81      */
       
    82     bool updateMailboxName (quint64 accountId, QString newName);
       
    83         
       
    84     /*!
       
    85     \fn bool unregisterMailbox (quint64 accountId)
       
    86     \param accountId The ID of the mailbox to unregister
       
    87     \return true if mailbox unregistration succeed. false if failed.
       
    88 
       
    89     This method unregisters mailbox from application library.
       
    90 
       
    91     Usage example:
       
    92 
       
    93     QServiceManager manager;    
       
    94     QServiceFilter filter("com.nokia.symbian.IEmailRegisterAccount");
       
    95     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
       
    96     QObject *widgetObject = manager.loadInterface(interfaces.first());
       
    97 
       
    98     QMetaObject::invoke(widgetObject,
       
    99             "unregisterMailbox",
       
   100             Q_ARG(quint64, accountId));
       
   101      */
       
   102     bool unregisterMailbox (quint64 accountId);
       
   103 
       
   104 private: 
       
   105     /**
       
   106     * Pointer to a private implementation.
       
   107     */
       
   108     NmMailboxRegisterInterfacePrivate* const m_d;
       
   109 
       
   110 };
       
   111 
       
   112 #endif /* NMMAILBOXREGISTERINTERFACE_H_ */
       
   113 
       
   114 
       
   115