Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CalendarList object
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 25 Dec 2016 01:26:47 +0000 (01:26 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 25 Dec 2016 01:26:47 +0000 (01:26 +0000)
source/objects/calendarlist/CalendarList.cpp [new file with mode: 0644]
source/objects/calendarlist/CalendarList.h [new file with mode: 0644]

diff --git a/source/objects/calendarlist/CalendarList.cpp b/source/objects/calendarlist/CalendarList.cpp
new file mode 100644 (file)
index 0000000..514b3e6
--- /dev/null
@@ -0,0 +1,73 @@
+// CalendarList.cpp - Account calendar list.
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Calendar 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, version 3 of the license.
+//
+// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/> 
+
+#include "CalendarList.h"
+
+using namespace std;
+
+XCAccountCalendarList::XCAccountCalendarList(string calendarListFilename){
+       
+       // Load the account calendar list.
+       
+       wxString calendarListFilenameFull;
+       
+       calendarListFilenameFull.Append(calendarListFilename);
+       calendarListFilenameFull.Append(wxT("/calendarlist.db"));
+
+       wxFileConfig *calendarListFile = new wxFileConfig("", "", calendarListFilenameFull);
+       
+       // Go through the list of calendars.
+       
+       bool continueProcessing = true;
+       wxString accountName;
+       long itemIndex =0;
+       
+       continueProcessing = calendarListFile->GetFirstGroup(accountName, itemIndex);
+       
+       while (continueProcessing){
+               
+               wxString valueData;
+               Colour colourData;
+               
+               calendarListFile->SetPath(accountName);
+
+               calendarShortName.push_back(string(accountName.mb_str()));
+               
+               calendarListFile->Read(wxT("name"), &valueData);
+               calendarName.push_back(string(valueData.mb_str()));
+
+               calendarListFile->Read(wxT("description"), &valueData);
+               calendarDescription.push_back(string(valueData.mb_str()));
+
+               calendarListFile->Read(wxT("colour"), &valueData);
+               colourData = string(valueData.mb_str());
+               calendarColour.push_back(colourData);
+               
+               calendarStorageID.push_back(0);
+               
+               accountName.clear();
+               calendarListFile->SetPath(wxT("/"));
+               continueProcessing = calendarListFile->GetNextGroup(accountName, itemIndex);
+
+       }
+       
+}
+
+XCAccountCalendarList::~XCAccountCalendarList(){
+       
+}
\ No newline at end of file
diff --git a/source/objects/calendarlist/CalendarList.h b/source/objects/calendarlist/CalendarList.h
new file mode 100644 (file)
index 0000000..ee9323a
--- /dev/null
@@ -0,0 +1,46 @@
+// CalendarList.h - Account calendar list header.
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Calendar 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, version 3 of the license.
+//
+// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/> 
+
+#ifndef __OBJECTS_CALENDARLIST_CALENDARLIST_H__
+#define __OBJECTS_CALENDARLIST_CALENDARLIST_H__
+
+#include <iostream>
+#include <iomanip>
+#include <ios>
+#include <string>
+#include <vector>
+#include <wx/fileconf.h>
+
+#include "colour.h"
+
+class XCAccountCalendarList{
+       
+       public:
+               std::vector<string> calendarShortName;
+               std::vector<string> calendarName;
+               std::vector<string> calendarDescription;
+               std::vector<Colour> calendarColour;
+               std::vector<int> calendarStorageID;
+
+               XCAccountCalendarList(std::string calendarListFilename);
+               ~XCAccountCalendarList();
+
+       
+};
+
+#endif
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy