~renatofilho/address-book-service/remove-updater

« back to all changes in this revision

Viewing changes to updater/ab-notify-message.h

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2015-10-07 13:31:56 UTC
  • Revision ID: renato.filho@canonical.com-20151007133156-kkhk8g865a6uyj04
Remove updater app.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2015 Canonical Ltd.
3
 
 *
4
 
 * This file is part of address-book-service.
5
 
 *
6
 
 * sync-monitor is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; version 3.
9
 
 *
10
 
 * contact-service-app is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
#pragma once
20
 
#include <QtCore/QString>
21
 
#include <QtCore/QObject>
22
 
 
23
 
#include <libnotify/notify.h>
24
 
 
25
 
class ABNotifyMessage : public QObject
26
 
{
27
 
    Q_OBJECT
28
 
public:
29
 
    ABNotifyMessage(bool singleMessage, QObject *parent = 0);
30
 
    ~ABNotifyMessage();
31
 
 
32
 
    void show(const QString &title, const QString &msg, const QString &iconName);
33
 
    void askYesOrNo(const QString &title, const QString &msg, const QString &iconName);
34
 
    int closedReason() const;
35
 
 
36
 
Q_SIGNALS:
37
 
    void questionAccepted();
38
 
    void questionRejected();
39
 
    void messageClosed();
40
 
 
41
 
private:
42
 
    NotifyNotification *m_notification;
43
 
    bool m_singleMessage;
44
 
    static int m_instanceCount;
45
 
 
46
 
    static void onQuestionAccepted(NotifyNotification *notification,
47
 
                                   char *action,
48
 
                                   ABNotifyMessage *self);
49
 
    static void onQuestionRejected(NotifyNotification *notification,
50
 
                                   char *action,
51
 
                                   ABNotifyMessage *self);
52
 
    static void onNotificationClosed(NotifyNotification *notification,
53
 
                                     ABNotifyMessage *self);
54
 
};