/* tabarray.h
 *
 * Copyright (C) 1998-1999 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

#include <pangomm/attrlist.h>
#include <pango/pango.h>
#include <utility>

_DEFS(pangomm,pango)

namespace Pango
{

_WRAP_ENUM(TabAlign, PangoTabAlign, decl_prefix PANGOMM_API)

/** A Pango::TabArray contains an array of tab stops.
 * Each tab stop has an alignment and a position.
 */
class PANGOMM_API TabArray
{
  _CLASS_BOXEDTYPE(TabArray, PangoTabArray, NONE, pango_tab_array_copy, pango_tab_array_free, PANGOMM_API)
  _IGNORE(pango_tab_array_free, pango_tab_array_copy, pango_tab_array_get_tab, pango_tab_array_get_tabs, pango_tab_array_new_with_positions)
public:
  explicit TabArray(int initial_size, bool positions_in_pixels = true);

  _WRAP_METHOD(int get_size() const, pango_tab_array_get_size)
  _WRAP_METHOD(void resize(int new_size), pango_tab_array_resize)
  _WRAP_METHOD(void set_tab(int tab_index, TabAlign alignment, int location), pango_tab_array_set_tab)

  /** Gets the alignment and position of a tab stop.
   * @return An std::pair<TabAlign, int>. The first element represents the tab stop alignment, the second one is the tab position.
   */
  std::pair<TabAlign,int> get_tab(int tab_index) const;

  /** Gets an array of std::pairs containing the tab stop alignments and tab positions.
   * @return An array of std::pair<TabAlign, int>. The first element in each pair represents the tab stop alignment, the second one is the tab position.
   */
  Glib::ArrayHandle< std::pair<TabAlign,int> > get_tabs() const;

  _WRAP_METHOD(bool get_positions_in_pixels() const, pango_tab_array_get_positions_in_pixels)
};

} //namespace Pango
