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

    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_PO_COMPLETION_PROTO_HEADER
#define LIFEOGRAPH_PO_COMPLETION_PROTO_HEADER


#include <gtkmm.h>
#include "gdkmm/rectangle.h"

#include "../helpers.hpp"


namespace LoG
{

using namespace HELPERS;

// WIDGET FOR SELECTING FROM DEFINED FILTERS IN THE DIARY ==========================================
class PoCompletionProto : public Gtk::Popover
{
    public:
        PoCompletionProto( Gtk::Widget& parent )
        { 
            set_parent( parent );
            set_autohide( false );
        }

        virtual ~PoCompletionProto()
        {
            unparent();
        }

        bool
        is_on_display() const
        { return get_visible(); }

        void
        popup( const Gdk::Rectangle& rect )
        {
            set_pointing_to( rect );
            Gtk::Popover::popup();
        }

        virtual bool
        handle_key( guint, bool, bool ) = 0;

    protected:
        Glib::RefPtr< Gtk::Builder >
                                    m_builder;
        Gtk::ListBox*               m_LB;
        // const Gtk::Widget&         m_W_parent;

        int                         m_F_internal    { 0 };
};

} // end of namespace LoG

#endif
