2012-07-17 12:05:52 +04:00
|
|
|
/*
|
|
|
|
* $Id: ede-panel.cpp 3330 2012-05-28 10:57:50Z karijes $
|
|
|
|
*
|
2015-12-16 20:05:02 +03:00
|
|
|
* Copyright (C) 2012-2014 Sanel Zukan
|
2012-07-17 12:05:52 +04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2012-05-09 19:56:06 +04:00
|
|
|
#ifndef __NOTIFYWINDOW_H__
|
|
|
|
#define __NOTIFYWINDOW_H__
|
|
|
|
|
|
|
|
#include <FL/Fl_Window.H>
|
|
|
|
#include <FL/Fl_Button.H>
|
|
|
|
#include <FL/Fl_Box.H>
|
2012-05-10 15:09:35 +04:00
|
|
|
#include <FL/Fl_Multiline_Output.H>
|
2012-05-09 19:56:06 +04:00
|
|
|
|
|
|
|
/* just keep it greater than FL_WINDOW or FL_DOUBLE_WINDOW */
|
|
|
|
#define NOTIFYWINDOW_TYPE 0xF9
|
|
|
|
|
|
|
|
class NotifyWindow : public Fl_Window {
|
|
|
|
private:
|
2015-12-16 20:05:02 +03:00
|
|
|
unsigned int id;
|
|
|
|
int exp, timer_set;
|
2012-05-09 19:56:06 +04:00
|
|
|
Fl_Button *closeb;
|
|
|
|
Fl_Box *imgbox;
|
2012-05-10 15:09:35 +04:00
|
|
|
Fl_Multiline_Output *summary, *body;
|
2012-05-09 19:56:06 +04:00
|
|
|
|
2012-07-17 12:05:52 +04:00
|
|
|
void add_timeout(void);
|
|
|
|
void remove_timeout(void);
|
2012-05-09 19:56:06 +04:00
|
|
|
public:
|
|
|
|
NotifyWindow();
|
|
|
|
|
2015-12-16 20:05:02 +03:00
|
|
|
void set_id(unsigned int i) { id = i; }
|
|
|
|
unsigned int get_id(void) { return id; }
|
2012-05-09 19:56:06 +04:00
|
|
|
|
|
|
|
void set_icon(const char *img);
|
2012-05-10 15:09:35 +04:00
|
|
|
void set_summary(const char *s) { summary->value(s); }
|
2012-05-15 14:28:08 +04:00
|
|
|
void set_body(const char *s);
|
2012-05-09 19:56:06 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* match to spec: if is -1, then we handle it, if is 0, then window will not be closed and
|
|
|
|
* the rest is sender specific
|
|
|
|
*/
|
2015-12-16 20:05:02 +03:00
|
|
|
void set_expire(int t, bool update_timer) {
|
|
|
|
exp = t;
|
|
|
|
// if(update_timer) {
|
|
|
|
// remove_timeout();
|
|
|
|
// add_timeout();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
2012-05-09 19:56:06 +04:00
|
|
|
void show(void);
|
2012-05-10 15:09:35 +04:00
|
|
|
|
|
|
|
virtual void resize(int X, int Y, int W, int H);
|
2012-07-17 12:05:52 +04:00
|
|
|
virtual int handle(int event);
|
2012-05-09 19:56:06 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|