update doku

pull/23/head
JuanJakobo 2022-07-20 14:53:25 +02:00
parent 095956c4e6
commit e87ddf534b
11 changed files with 60 additions and 66 deletions

View File

@ -25,7 +25,6 @@ public:
~SqliteConnector(); ~SqliteConnector();
//TODO DOKU, open neede?
bool open(); bool open();
std::vector<WebDAVItem> getItemsChildren(const std::string &parenthPath); std::vector<WebDAVItem> getItemsChildren(const std::string &parenthPath);

View File

@ -10,12 +10,9 @@
#define WEBDAVITEM #define WEBDAVITEM
#include "model.h" #include "model.h"
//TODO use own
#include "item.h"
#include <string> #include <string>
/*
enum Itemtype enum Itemtype
{ {
IFILE, IFILE,
@ -29,7 +26,6 @@ enum FileState
IOUTSYNCED, IOUTSYNCED,
ILOCAL ILOCAL
}; };
*/
struct WebDAVItem : Entry{ struct WebDAVItem : Entry{
std::string etag; std::string etag;
@ -39,7 +35,7 @@ struct WebDAVItem : Entry{
FileState state{FileState::ICLOUD}; FileState state{FileState::ICLOUD};
Itemtype type; Itemtype type;
std::string lastEditDate{"Error"}; std::string lastEditDate{"Error"};
double size; std::string size;
std::string fileType; std::string fileType;
}; };

View File

@ -38,4 +38,4 @@ int ContextMenu::createMenu(int y, FileState itemstate, iv_menuhandler handler)
OpenMenu(contextMenu, 0, ScreenWidth(),y, handler); OpenMenu(contextMenu, 0, ScreenWidth(),y, handler);
return 1; return 1;
} }

View File

@ -10,7 +10,7 @@
#define CONTEXT_MENU #define CONTEXT_MENU
#include "inkview.h" #include "inkview.h"
#include "item.h" #include "webDAVModel.h"
#include <string> #include <string>
@ -23,10 +23,10 @@ public:
/** /**
* Shows the menu on the screen, lets the user choose menu options and then redirects the handler to the caller * Shows the menu on the screen, lets the user choose menu options and then redirects the handler to the caller
* *
* @param y y-coordinate of the item * @param y y-coordinate of the item
* @param FileState status of the item for that the menu is created * @param FileState status of the item for that the menu is created
* @param handler which action does the menu buttons start * @param handler which action does the menu buttons start
* @return int returns if the event was handled * @return int returns if the event was handled
*/ */
int createMenu(int y, FileState itemstate, iv_menuhandler handler); int createMenu(int y, FileState itemstate, iv_menuhandler handler);
@ -37,4 +37,4 @@ private:
char *_sync = strdup("Sync"); char *_sync = strdup("Sync");
char *_remove = strdup("Remove"); char *_remove = strdup("Remove");
}; };
#endif #endif

View File

@ -26,13 +26,13 @@ class EventHandler
{ {
public: public:
/** /**
* Defines fonds, sets global Event Handler and starts new content * Defines fonds, sets global Event Handler and starts new content
*/ */
EventHandler(); EventHandler();
/** /**
* Handles events and redirects them * Handles events and redirects them
* *
* @param type event type * @param type event type
* @param par1 first argument of the event * @param par1 first argument of the event
* @param par2 second argument of the event * @param par2 second argument of the event
@ -46,36 +46,35 @@ private:
std::unique_ptr<LoginView> _loginView; std::unique_ptr<LoginView> _loginView;
std::unique_ptr<ContextMenu> _contextMenu; std::unique_ptr<ContextMenu> _contextMenu;
std::vector<WebDAVItem> _currentWebDAVItems; std::vector<WebDAVItem> _currentWebDAVItems;
MainMenu _menu = MainMenu("Nextcloud"); std::unique_ptr<MainMenu> _menu;
Nextcloud _nextcloud = Nextcloud();
WebDAV _webDAV = WebDAV();
SqliteConnector _sqllite = SqliteConnector(DB_PATH); SqliteConnector _sqllite = SqliteConnector(DB_PATH);
std::string _tempPath;
int _tempItemID;
/** /**
* Function needed to call C function, redirects to real function * Function needed to call C function, redirects to real function
* *
* @param index int of the menu that is set * @param index int of the menu that is set
*/ */
static void mainMenuHandlerStatic(const int index); static void mainMenuHandlerStatic(const int index);
/** /**
* Handles menu events and redirects them * Handles menu events and redirects them
* *
* @param index int of the menu that is set * @param index int of the menu that is set
*/ */
void mainMenuHandler(const int index); void mainMenuHandler(const int index);
/** /**
* Function needed to call C function, redirects to real function * Function needed to call C function, redirects to real function
* *
* @param index int of the menu that is set * @param index int of the menu that is set
*/ */
static void contextMenuHandlerStatic(const int index); static void contextMenuHandlerStatic(const int index);
/** /**
* Handlescontext menu events and redirects them * Handlescontext menu events and redirects them
* *
* @param index int of the menu that is set * @param index int of the menu that is set
*/ */
@ -83,7 +82,7 @@ private:
/** /**
* Handles pointer Events * Handles pointer Events
* *
* @param type event type * @param type event type
* @param par1 first argument of the event * @param par1 first argument of the event
* @param par2 second argument of the event * @param par2 second argument of the event
@ -93,13 +92,13 @@ private:
/** /**
* Updates PB Library * Updates PB Library
* *
*/ */
void updatePBLibrary(); void updatePBLibrary();
/** /**
* Starts the download of an item * Starts the download of an item
* *
*/ */
void startDownload(); void startDownload();
@ -118,7 +117,7 @@ private:
/** /**
* Handles key Events * Handles key Events
* *
* @param type event type * @param type event type
* @param par1 first argument of the event (is the key) * @param par1 first argument of the event (is the key)
* @param par2 second argument of the event * @param par2 second argument of the event

View File

@ -17,8 +17,8 @@ class MainMenu
{ {
public: public:
/** /**
* Defines fonds, sets global Event Handler and starts new content * Defines fonds, sets global Event Handler and starts new content
* *
* @param name name of the application * @param name name of the application
*/ */
MainMenu(const std::string &name); MainMenu(const std::string &name);
@ -30,9 +30,9 @@ public:
/** /**
* Shows the menu on the screen, lets the user choose menu options and then redirects the handler to the caller * Shows the menu on the screen, lets the user choose menu options and then redirects the handler to the caller
* *
* @param loogedIn the status if the user is logged in * @param loogedIn the status if the user is logged in
* @param handler handles the clicks on the menu * @param handler handles the clicks on the menu
* @return int returns if the event was handled * @return int returns if the event was handled
*/ */
int createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler); int createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler);
@ -61,4 +61,4 @@ private:
*/ */
static void panelHandlerStatic(); static void panelHandlerStatic();
}; };
#endif #endif

View File

@ -55,13 +55,13 @@ public:
void reDrawCurrentEntry(); void reDrawCurrentEntry();
/** /**
* inverts the color of the currently selected entry * inverts the color of the currently selected entry
*/ */
void invertCurrentEntryColor(); void invertCurrentEntryColor();
/** /**
* Checkes if the listview has been clicked and either changes the page or returns item ID * Checkes if the listview has been clicked and either changes the page or returns item ID
* *
* @param x x-coordinate * @param x x-coordinate
* @param y y-coordinate * @param y y-coordinate
* @return true if was clicked * @return true if was clicked
@ -71,11 +71,11 @@ public:
int getCurrentEntryItertator() const {return _selectedEntry;}; int getCurrentEntryItertator() const {return _selectedEntry;};
/** /**
* Clears the screen and draws entries and footer * Clears the screen and draws entries and footer
* *
*/ */
void draw(); void draw();
protected: protected:
int _footerHeight; int _footerHeight;
int _footerFontHeight; int _footerFontHeight;
@ -101,20 +101,20 @@ protected:
void drawEntries(); void drawEntries();
/** /**
* Draws the footer including a page changer * Draws the footer including a page changer
*/ */
void drawFooter(); void drawFooter();
/** /**
* updates an entry * updates an entry
* *
* @param entryID the id of the item that shall be inverted * @param entryID the id of the item that shall be inverted
*/ */
void updateEntry(int entryID); void updateEntry(int entryID);
/** /**
* Navigates to the selected page * Navigates to the selected page
* *
* @param pageToShow page that shall be shown * @param pageToShow page that shall be shown
*/ */
void actualizePage(int pageToShow); void actualizePage(int pageToShow);

View File

@ -16,8 +16,8 @@ class ListViewEntry
{ {
public: public:
/** /**
* Creates an ListViewEntry * Creates an ListViewEntry
* *
* @param Page site of the listView the Entry is shown * @param Page site of the listView the Entry is shown
* @param Rect area of the screen the item is positioned * @param Rect area of the screen the item is positioned
*/ */
@ -30,10 +30,10 @@ public:
/** /**
* draws the listViewEntry to the screen * draws the listViewEntry to the screen
* *
* @param entryFont font for the entry itself * @param entryFont font for the entry itself
* @param entryFontBold bold font for the header * @param entryFontBold bold font for the header
* @param fontHeight height of the font * @param fontHeight height of the font
*/ */
virtual void draw(const ifont *entryFont, const ifont *entryFontBold, int fontHeight) = 0; virtual void draw(const ifont *entryFont, const ifont *entryFontBold, int fontHeight) = 0;
@ -43,4 +43,4 @@ protected:
int _page; int _page;
irect _position; irect _position;
}; };
#endif #endif

View File

@ -26,8 +26,8 @@ class LoginView
{ {
public: public:
/** /**
* Draws the loginView includin URL, Username and Password buttons inside the contentRect * Draws the loginView includin URL, Username and Password buttons inside the contentRect
* *
* @param contentRect area where the loginscreen shall be drawn * @param contentRect area where the loginscreen shall be drawn
*/ */
LoginView(const irect *contentRect); LoginView(const irect *contentRect);
@ -36,7 +36,7 @@ public:
/** /**
* Checks which part of the loginscreen is shown and reacts accordingly * Checks which part of the loginscreen is shown and reacts accordingly
* *
* @param x x-coordinate * @param x x-coordinate
* @param y y-coordinate * @param y y-coordinate
* @return int if event has been handled. Returns 2 if login has been clicked and all items are set * @return int if event has been handled. Returns 2 if login has been clicked and all items are set
@ -64,17 +64,17 @@ private:
/** /**
* Functions needed to call C function, handles the keyboard * Functions needed to call C function, handles the keyboard
* *
* @param text text that has been typed in by the user * @param text text that has been typed in by the user
*/ */
static void keyboardHandlerStatic(char *text); static void keyboardHandlerStatic(char *text);
/** /**
* Called by the static method and saves and writes the input from the user to the screen * Called by the static method and saves and writes the input from the user to the screen
* *
* @param text text that has been typed in by the user * @param text text that has been typed in by the user
*/ */
void keyboardHandler(char *text); void keyboardHandler(char *text);
}; };
#endif #endif

View File

@ -157,4 +157,4 @@ void Util::updatePBLibrary(int seconds)
execlp(cmd.c_str(), cmd.c_str(), (char *)NULL); execlp(cmd.c_str(), cmd.c_str(), (char *)NULL);
exit(1); exit(1);
} }
} }

View File

@ -26,28 +26,28 @@ class Util
public: public:
/** /**
* Handles the return of curl command * Handles the return of curl command
* *
*/ */
static size_t writeCallback(void *contents, size_t size, size_t nmemb, void *userp); static size_t writeCallback(void *contents, size_t size, size_t nmemb, void *userp);
/** /**
* Saves the return of curl command * Saves the return of curl command
* *
*/ */
static size_t writeData(void *ptr, size_t size, size_t nmemb, FILE *stream); static size_t writeData(void *ptr, size_t size, size_t nmemb, FILE *stream);
/** /**
* Checks if a network connection can be established * Checks if a network connection can be established
* *
* @return true - network access succeeded, false - network access failed * @return true - network access succeeded, false - network access failed
*/ */
static bool connectToNetwork(); static bool connectToNetwork();
//TODO Doku static std::string accessConfig(const std::string &path, const Action &action, const std::string &name, const std::string &value = std::string());
static std::string accessConfig(const Action &action, const std::string &name, const std::string &value = std::string());
/** /**
* Returns an integer representing the download progress * Returns an integer representing the download progress
* *
*/ */
static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
@ -58,18 +58,18 @@ public:
/** /**
* Decodes an URL * Decodes an URL
* *
* @param text text that shall be converted * @param text text that shall be converted
*/ */
static void decodeUrl(std::string &text); static void decodeUrl(std::string &text);
/** /**
* Updates the library of the Pocketbook * Updates the library of the Pocketbook
* *
*/ */
static void updatePBLibrary(int seconds); static void updatePBLibrary(int seconds);
private: private:
Util() {} Util() {}
}; };
#endif #endif