aqt.flags
=========

.. py:module:: aqt.flags


Classes
-------

.. autoapisummary::

   aqt.flags.Flag
   aqt.flags.FlagManager


Module Contents
---------------

.. py:class:: Flag

   A container class for flag related data.

   index -- The integer by which the flag is represented internally (1-7).
   label -- The text by which the flag is described in the GUI.
   icon -- The icon by which the flag is represented in the GUI.
   search_node -- The node to build a search string for finding cards with the flag.
   action -- The name of the action to assign the flag in the browser form.


   .. py:attribute:: index
      :type:  int


   .. py:attribute:: label
      :type:  str


   .. py:attribute:: icon
      :type:  aqt.theme.ColoredIcon


   .. py:attribute:: search_node
      :type:  anki.collection.SearchNode


   .. py:attribute:: action
      :type:  str


.. py:class:: FlagManager(mw: aqt.main.AnkiQt)

   .. py:attribute:: mw


   .. py:method:: all() -> list[Flag]

      Return a list of all flags.



   .. py:method:: get_flag(flag_index: int) -> Flag


   .. py:method:: rename_flag(flag_index: int, new_name: str) -> None


   .. py:method:: restore_default_flag_name(flag_index: int) -> None


   .. py:method:: require_refresh() -> None

      Discard cached labels.



