/***********************************************************************************

    Copyright (C) 2007-2026 Ahmet Öztürk (aoz_2@yahoo.com)

    This file is part of Lifeograph.

    Lifeograph 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, either version 3 of the License, or
    (at your option) any later version.

    Lifeograph 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 Lifeograph.  If not, see <http://www.gnu.org/licenses/>.

***********************************************************************************/


#ifndef LIFEOGRAPH_DIALOG_POPUP_NOTE_HEADER
#define LIFEOGRAPH_DIALOG_POPUP_NOTE_HEADER


#include <gtkmm.h>

#include "../widgets/widget_textviewpopup.hpp"
#include "../widgets/po_entry.hpp"


namespace LoG
{


class DialogPopupNote : public Gtk::Window
{
    public:
        static DialogPopupNote*     create( DiaryElemTag*, bool = false );

                                    DialogPopupNote( BaseObjectType*,
                                                     const Glib::RefPtr< Gtk::Builder >& );
        virtual                     ~DialogPopupNote()
        { m_TvD->disband(); }

        TextviewDiaryPopup*         get_textview() { return m_TvD; }

        void                        refresh_editability();
        void                        refresh_icon();

    protected:
        bool                        on_key_press_event( guint, guint, Gdk::ModifierType );

        void                        handle_search();
        void                        go_search_prev();
        void                        go_search_next();

        TextviewDiaryPopup*         m_TvD;
        Gtk::Label*                 m_L_title;
        Gtk::Label*                 m_L_info;
        Gtk::Image*                 m_I_lock;
        Gtk::Button*                m_B_entry;
        Gtk::Image*                 m_I_entry;
        Gtk::Box*                   m_Bx_search;
        Gtk::SearchEntry*           m_E_search;

        PoEntry                     m_CPo_entry { PoEntry::Mode::POPUP };

        VecInts                     m_matches;
};

} // end of namespace LoG

#endif

