Help with creating WebBrowser with LinkedList
Assume you have all classes and cpp. Working properly except the WebBrowser class and cpp I need
Node.h and cpp :
void setEntry(ItemType entry); , ItemType getEntry() const; , Node(const ItemType& entry, Node* nextNodePtr); , Node(ItemType& entry); void setNext(Node* next); Node* getNext() const;
private: ItemType m_entry; Node* m_next;
LinkedList.h and cpp
have all, insert, remove, replace, getEntry(int pos), getlength(), getNodeAt, ..etc.
Tab header and cpp all worked.
Please help to implement the WebBrowser Tab and cpp
WebBrowser class and cpp I need
WebBrowser class and cpp I need
THANK YOU
Ueb brousers can do amazing things, but some of tr unctionality is as simple as maintaining a list. In this lab, you will build a mock web browser, read commands from a flile that let you knou what buttons are being pushed and what URLs are being nauigated to, and you uill track a List of Tabs. Each Tab will haue its oun brouser history This is still a terminal programl you don't nted to kn0 an networking or actually urte code for a web browser Updating Linkedlist dass You can use your old LinkedList for this lab, but youllneed to update it be templated. That means youll also haue to update your node to betemplated as well. Both your Tab cass and WebBrouser dass willuse Lists, but theyll need Lists of different types. Tab dass Below is a header file for your Tab dass. ou can add constructors, destructors, operator ouerloads, and private helper methods. lou may not add any other type of public method. #include "LinkedListh" #include
: class Tab public: * @pre none * @post the browser navigate to the given url * @param url, a string representing a URL * @pre none *@post the browser navigate to the given url * @param url, a string representing a URL void navigate To(std::string url); k* * @pre none *@post if possible, the browser navigates forward in the history otherwise it keeps focus * on the current URL void forward(); t * * @pre none *@post if possible, the browser navigates backwards in the history otherwise it keeps focus *on the current URL void back(); k* *@return the URL currently open in the tab std::string currentUR() const; * @pre The list being passed in is empty * @post The current browser history is copied into the given list * @param destination, an empty list of strings * @return the position in the list with focus (zero if there is no history) int copyCurrentHistory(LinkedList& destination); WebBrouser lass You will dlso need design and inplement a Browser dass, uhich can manage severdl tabs. How many tabs? That's up to the file. What can a brouse do? .Open new tab lose existing tab Suitch focus to aparticular tab Moue a tab left or right in the List of tabs note, when you moue a tab, no tabs are lost, they only rearrange in order o Reading the from fle Reading the from file Commands ta interaet with yeur browser will came from a file. The file name will ceme in en the command line. Any given line of the file will cantain one of the fellewing entries. Same commands pertain to the browser and some pertain to a tab. I've separated them Irto twe tables, but a single file will cantain commands From bath tables Browser Command Deserption Creates a new tab at the end of the list of tab and immedately gives it focus NEWYAB Focus Switches focus to the tab at pesition f to tetal num tabs. CLOSE Cleses the tab at the indicated position. wth focus MOVE LEF Moves the tab with foces leFt amount times. F It reaches the frant of the ist it stops there. Foces remains on the moved tab. Moves the tab with facus right amaont times. If it reaches the baek of the list it stops there. Focus remains on the moved tab. MeVE_RIGHY Prnts the tab nomber and cerrent ORL histary ta the sereen esing the following farmat: Tab # HISTORY but any URLs that would haue accessible from going fORUARD are nou lost A command indicating the eb brouser is redirected to the preuious URL in the history. If there is no URL further badh, then the brouse stays on the current URL A command indicating the ueb brouser is redirected to the next URL in the history. If there is no URL that is next, then the brouser stays on the current URL. FORUARD then the bro st Ueb brousers can do amazing things, but some of tr unctionality is as simple as maintaining a list. In this lab, you will build a mock web browser, read commands from a flile that let you knou what buttons are being pushed and what URLs are being nauigated to, and you uill track a List of Tabs. Each Tab will haue its oun brouser history This is still a terminal programl you don't nted to kn0 an networking or actually urte code for a web browser Updating Linkedlist dass You can use your old LinkedList for this lab, but youllneed to update it be templated. That means youll also haue to update your node to betemplated as well. Both your Tab cass and WebBrouser dass willuse Lists, but theyll need Lists of different types. Tab dass Below is a header file for your Tab dass. ou can add constructors, destructors, operator ouerloads, and private helper methods. lou may not add any other type of public method. #include "LinkedListh" #include : class Tab public: * @pre none * @post the browser navigate to the given url * @param url, a string representing a URL * @pre none *@post the browser navigate to the given url * @param url, a string representing a URL void navigate To(std::string url); k* * @pre none *@post if possible, the browser navigates forward in the history otherwise it keeps focus * on the current URL void forward(); t * * @pre none *@post if possible, the browser navigates backwards in the history otherwise it keeps focus *on the current URL void back(); k* *@return the URL currently open in the tab std::string currentUR() const; * @pre The list being passed in is empty * @post The current browser history is copied into the given list * @param destination, an empty list of strings * @return the position in the list with focus (zero if there is no history) int copyCurrentHistory(LinkedList& destination); WebBrouser lass You will dlso need design and inplement a Browser dass, uhich can manage severdl tabs. How many tabs? That's up to the file. What can a brouse do? .Open new tab lose existing tab Suitch focus to aparticular tab Moue a tab left or right in the List of tabs note, when you moue a tab, no tabs are lost, they only rearrange in order o Reading the from fle Reading the from file Commands ta interaet with yeur browser will came from a file. The file name will ceme in en the command line. Any given line of the file will cantain one of the fellewing entries. Same commands pertain to the browser and some pertain to a tab. I've separated them Irto twe tables, but a single file will cantain commands From bath tables Browser Command Deserption Creates a new tab at the end of the list of tab and immedately gives it focus NEWYAB Focus Switches focus to the tab at pesition f to tetal num tabs. CLOSE Cleses the tab at the indicated position. wth focus MOVE LEF Moves the tab with foces leFt amount times. F It reaches the frant of the ist it stops there. Foces remains on the moved tab. Moves the tab with facus right amaont times. If it reaches the baek of the list it stops there. Focus remains on the moved tab. MeVE_RIGHY Prnts the tab nomber and cerrent ORL histary ta the sereen esing the following farmat: Tab # HISTORY but any URLs that would haue accessible from going fORUARD are nou lost A command indicating the eb brouser is redirected to the preuious URL in the history. If there is no URL further badh, then the brouse stays on the current URL A command indicating the ueb brouser is redirected to the next URL in the history. If there is no URL that is next, then the brouser stays on the current URL. FORUARD then the bro st