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();
//TODO DOKU, open neede?
bool open();
std::vector<WebDAVItem> getItemsChildren(const std::string &parenthPath);

View File

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

View File

@ -10,7 +10,7 @@
#define CONTEXT_MENU
#include "inkview.h"
#include "item.h"
#include "webDAVModel.h"
#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
*
* @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 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
*/
int createMenu(int y, FileState itemstate, iv_menuhandler handler);
@ -37,4 +37,4 @@ private:
char *_sync = strdup("Sync");
char *_remove = strdup("Remove");
};
#endif
#endif

View File

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

View File

@ -17,8 +17,8 @@ class MainMenu
{
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
*/
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
*
*
* @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
*/
int createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler);
@ -61,4 +61,4 @@ private:
*/
static void panelHandlerStatic();
};
#endif
#endif

View File

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

View File

@ -16,8 +16,8 @@ class ListViewEntry
{
public:
/**
* Creates an ListViewEntry
*
* Creates an ListViewEntry
*
* @param Page site of the listView the Entry is shown
* @param Rect area of the screen the item is positioned
*/
@ -30,10 +30,10 @@ public:
/**
* draws the listViewEntry to the screen
*
*
* @param entryFont font for the entry itself
* @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;
@ -43,4 +43,4 @@ protected:
int _page;
irect _position;
};
#endif
#endif

View File

@ -26,8 +26,8 @@ class LoginView
{
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
*/
LoginView(const irect *contentRect);
@ -36,7 +36,7 @@ public:
/**
* Checks which part of the loginscreen is shown and reacts accordingly
*
*
* @param x x-coordinate
* @param y y-coordinate
* @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
*
*
* @param text text that has been typed in by the user
*/
static void keyboardHandlerStatic(char *text);
/**
* 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);
};
#endif
#endif

View File

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

View File

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