1 /* 2 Vimpc 3 Copyright (C) 2010 - 2011 Nathan Sweetman 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 lyricswindow.hpp - class representing a window that can scroll 19 */ 20 21 #ifndef __UI__LYRICSWINDOW 22 #define __UI__LYRICSWINDOW 23 24 #include <vector> 25 26 #include "buffers.hpp" 27 #include "lyricsfetcher.hpp" 28 #include "song.hpp" 29 30 #include "buffer/buffer.hpp" 31 #include "window/selectwindow.hpp" 32 33 namespace Main { class Settings; } 34 namespace Ui { class Search; } 35 36 namespace Ui 37 { 38 class LyricsWindow : public Ui::SelectWindow 39 { 40 public: 41 LyricsWindow(std::string const & URI, Main::Settings const & settings, Ui::Screen & screen, Mpc::Client & client, Mpc::ClientState & clientState, Ui::Search const & search, std::string name = "Unknown"); 42 ~LyricsWindow(); 43 44 private: 45 void Print(uint32_t line) const; 46 47 public: 48 void Redraw(); 49 void Edit(); 50 void Scroll(int32_t scrollCount); 51 void ScrollTo(uint32_t scrollLine); 52 SearchPattern(uint32_t id) const53 std::string SearchPattern(uint32_t id) const { return lyrics_.Get(id); } 54 55 protected: WindowBuffer() const56 Main::WindowBuffer const & WindowBuffer() const { return lyrics_; } 57 58 private: 59 void Clear(); 60 void LoadLyrics(); 61 void LyricsLoaded(); 62 63 private: 64 std::string m_URI; 65 Main::Settings const & settings_; 66 Ui::Search const & search_; 67 Main::Lyrics lyrics_; 68 }; 69 } 70 71 #endif // __UI__LYRICSWINDOW 72 73 /* vim: set sw=3 ts=3: */ 74