1 // XCCalendarDay.h - Xestia Calendar XCCalendarDay widget class header file.
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Calendar is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Calendar is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __WIDGETS_XCCALENDARDAY_H__
20 #define __WIDGETS_XCCALENDARDAY_H__
23 #include <wx/dcbuffer.h>
24 #include <wx/mstream.h>
28 #include "XCCalendarDayEntry.h"
29 #include "XCCalendarMonthView.h"
30 #include "../common/events.h"
31 #include "../bitmaps.h"
33 #include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
35 class XCCalendarMonthView;
37 class XCCalendarDay: public wxPanel
40 XCCalendarMonthView *monthViewPointer = nullptr;
41 wxPanel *topPanel = nullptr;
42 wxPanel *mainPanel = nullptr;
43 wxBoxSizer *windowSizer = new wxBoxSizer(wxVERTICAL);
44 wxBoxSizer *topSectionSizer = new wxBoxSizer(wxHORIZONTAL);
45 wxBoxSizer *mainSectionSizer = new wxBoxSizer(wxVERTICAL);
46 wxBoxSizer *eventListFrameSizer = new wxBoxSizer(wxVERTICAL);
47 wxStaticBitmap *highPriorityIcon = nullptr;
48 wxStaticBitmap *alertIcon = nullptr;
49 CalendarDataStorage *dataStorage = nullptr;
50 wxBitmap alertIconBitmap;
51 wxBitmap priorityIconBitmap;
52 wxStaticText *numberText = nullptr;
53 wxScrolledWindow *eventListFrame = nullptr;
54 int calendarEntrySeekNumber = 0;
56 int calendarMonth = 0;
58 bool isInMonth = false;
60 vector<XCCalendarDayEntry*> calendarEntryList;
63 void HideAccountEntries(wxCommandEvent &accountData);
64 void ShowAccountEntries(wxCommandEvent &accountData);
65 void HideCalendarEntries(wxCommandEvent &calendarData);
66 void ShowCalendarEntries(wxCommandEvent &calendarData);
67 void DeleteCalendarEntries(wxCommandEvent &calendarData);
68 void DeleteCalendarEntry(wxCommandEvent &eventData);
69 void AddCalendarEntry(wxCommandEvent &eventData);
70 void UpdateCalendarEntry(wxCommandEvent &eventData);
71 void UpdateCalendarColour(wxCommandEvent &colourData);
74 XCCalendarDay(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size);
76 void ResizeFrameEvent(wxSizeEvent &sizeEvent);
77 void DeselectOthersEvent(wxCommandEvent &deselectEvent);
78 void DeselectAllEvent(wxCommandEvent &deselectEvent);
79 void UpdateTopIcons();
80 void SetupControl(int setupDay, int setupMonth, int setupYear, bool setupIsInMonth, XCCalendarMonthView *monthViewPointer, CalendarDataStorage *dataStorage, std::vector<int> *hideAccounts, std::vector<int> *hideCalendars);
82 int GetCalendarMonth();
83 int GetCalendarYear();