summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas M. Gastal <jgastal@profusion.mobi>2011-06-15 14:13:58 +0000
committerJonas M. Gastal <jgastal@profusion.mobi>2011-06-15 14:13:58 +0000
commit2f4ad4f6a2109aa058343e8e4fb02c025ac56b2d (patch)
treed220f2d17919a6b3c1ba74eefc73446503fb4ed4
parentd1637cfe9f75cad6ad61d3863c61611e3a892cbe (diff)
Elementary: actionslider documentation.
SVN revision: 60349
-rw-r--r--doc/Doxyfile.in2
-rw-r--r--src/lib/Elementary.h.in108
-rw-r--r--src/lib/elm_actionslider.c123
3 files changed, 103 insertions, 130 deletions
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 564c3f395..cf0189fe3 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1,7 +1,7 @@
1PROJECT_NAME = Elementary 1PROJECT_NAME = Elementary
2PROJECT_NUMBER = 2PROJECT_NUMBER =
3OUTPUT_DIRECTORY = . 3OUTPUT_DIRECTORY = .
4INPUT = @srcdir@/elementary.dox @top_srcdir@/src/lib 4INPUT = @srcdir@/elementary.dox @top_srcdir@/src/lib/Elementary.h.in @top_srcdir@/src/lib
5IMAGE_PATH = @srcdir@/img 5IMAGE_PATH = @srcdir@/img
6OUTPUT_LANGUAGE = English 6OUTPUT_LANGUAGE = English
7GENERATE_HTML = YES 7GENERATE_HTML = YES
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 340388070..e45bae41c 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -1858,7 +1858,26 @@ extern "C" {
1858 * expensive reactions to the value change. 1858 * expensive reactions to the value change.
1859 */ 1859 */
1860 1860
1861 /* actionslider */ 1861 /**
1862 * @addtogroup Actionslider Actionslider
1863 *
1864 * A actionslider is a switcher for 2 or 3 labels with customizable magnet
1865 * properties. The indicator is the element the user drags to choose a label.
1866 * When the position is set with magnet, when released the indicator will be
1867 * moved to it if it's nearest the magnetized position.
1868 *
1869 * @note By default all positions are set as enabled.
1870 *
1871 * Signals that you can add callbacks for are:
1872 *
1873 * "selected" - when user selects an enabled position (the label is passed
1874 * as event info)".
1875 * @n
1876 * "pos_changed" - when the indicator reaches any of the positions("left",
1877 * "right" or "center").
1878 *
1879 * @{
1880 */
1862 typedef enum _Elm_Actionslider_Pos 1881 typedef enum _Elm_Actionslider_Pos
1863 { 1882 {
1864 ELM_ACTIONSLIDER_NONE = 0, 1883 ELM_ACTIONSLIDER_NONE = 0,
@@ -1868,23 +1887,100 @@ extern "C" {
1868 ELM_ACTIONSLIDER_ALL = (1 << 3) -1 1887 ELM_ACTIONSLIDER_ALL = (1 << 3) -1
1869 } Elm_Actionslider_Pos; 1888 } Elm_Actionslider_Pos;
1870 1889
1890 /**
1891 * Add a new actionslider to the parent.
1892 *
1893 * @param parent The parent object
1894 * @return The new actionslider object or NULL if it cannot be created
1895 */
1871 EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent) EINA_ARG_NONNULL(1); 1896 EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
1897 /**
1898 * Set actionslider labels.
1899 *
1900 * @param obj The actionslider object
1901 * @param left_label The label to be set on the left.
1902 * @param center_label The label to be set on the center.
1903 * @param right_label The label to be set on the right.
1904 */
1872 EAPI void elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label) EINA_ARG_NONNULL(1); 1905 EAPI void elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label) EINA_ARG_NONNULL(1);
1906 /**
1907 * Get actionslider labels.
1908 *
1909 * @param obj The actionslider object
1910 * @param left_label A char** to place the left_label of @p obj into.
1911 * @param center_label A char** to place the center_label of @p obj into.
1912 * @param right_label A char** to place the right_label of @p obj into.
1913 */
1873 EAPI void elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) EINA_ARG_NONNULL(1); 1914 EAPI void elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) EINA_ARG_NONNULL(1);
1915 /**
1916 * Get actionslider selected label.
1917 *
1918 * @param obj The actionslider object
1919 * @return The selected label
1920 */
1874 EAPI const char *elm_actionslider_selected_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 1921 EAPI const char *elm_actionslider_selected_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1922 /**
1923 * Set actionslider indicator position.
1924 *
1925 * @param obj The actionslider object.
1926 * @param pos The position of the indicator.
1927 */
1875 EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1); 1928 EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
1929 /**
1930 * Get actionslider indicator position.
1931 *
1932 * @param obj The actionslider object.
1933 * @return The position of the indicator.
1934 */
1876 EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 1935 EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1936 /**
1937 * Set actionslider magnet position. To make multiple positions magnets @c or
1938 * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
1939 *
1940 * @param obj The actionslider object.
1941 * @param pos Bit mask indicating the magnet positions.
1942 */
1877 EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1); 1943 EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
1944 /**
1945 * Get actionslider magnet position.
1946 *
1947 * @param obj The actionslider object.
1948 * @return The positions with magnet property.
1949 */
1878 EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 1950 EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1951 /**
1952 * Set actionslider enabled position. To set multiple positions as enabled @c or
1953 * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT).
1954 *
1955 * @note All the positions are enabled by default.
1956 *
1957 * @param obj The actionslider object.
1958 * @param pos Bit mask indicating the enabled positions.
1959 */
1879 EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1); 1960 EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
1961 /**
1962 * Get actionslider enabled position.
1963 *
1964 * @param obj The actionslider object.
1965 * @return The enabled positions.
1966 */
1880 EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 1967 EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1968 /**
1969 * Set the label used on the indicator.
1970 *
1971 * @param obj The actionslider object
1972 * @param label The label to be set on the indicator.
1973 */
1881 EAPI void elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); 1974 EAPI void elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
1975 /**
1976 * Get the label used on the indicator object.
1977 *
1978 * @param obj The actionslider object
1979 * @return The indicator label
1980 */
1882 EAPI const char *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1); 1981 EAPI const char *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
1883 /* smart callbacks called: 1982 /**
1884 * "selected" - when user selects a position (the label is passed as 1983 * @}
1885 * event info)".
1886 * "pos_changed" - when a button reaches to the special position like
1887 * "left", "right" and "center".
1888 */ 1984 */
1889 1985
1890 /* genlist */ 1986 /* genlist */
diff --git a/src/lib/elm_actionslider.c b/src/lib/elm_actionslider.c
index 6ad28cd64..289dd561c 100644
--- a/src/lib/elm_actionslider.c
+++ b/src/lib/elm_actionslider.c
@@ -1,18 +1,3 @@
1/**
2 * @addtogroup Actionslider Actionslider
3 *
4 * A actionslider is a switcher for 3 labels with customizable
5 * magnet properties. When the position is set with magnet, the knob
6 * will be moved to it if it's nearest the magnetized position.
7 *
8 * Signals that you can add callbacks for are:
9 *
10 * "selected" - when user selects a position (the label is passed as
11 * event info)".
12 * "pos_changed" - when a button reaches to the special position like
13 * "left", "right" and "center".
14 */
15
16#include <Elementary.h> 1#include <Elementary.h>
17#include <math.h> 2#include <math.h>
18#include "elm_priv.h" 3#include "elm_priv.h"
@@ -335,14 +320,6 @@ _drag_button_up_cb(void *data, Evas_Object *o __UNUSED__, const char *emission _
335#undef _FINAL_POS_BY_ORIENTATION 320#undef _FINAL_POS_BY_ORIENTATION
336} 321}
337 322
338/**
339 * Add a new actionslider to the parent.
340 *
341 * @param parent The parent object
342 * @return The new actionslider object or NULL if it cannot be created
343 *
344 * @ingroup Actionslider
345 */
346EAPI Evas_Object * 323EAPI Evas_Object *
347elm_actionslider_add(Evas_Object *parent) 324elm_actionslider_add(Evas_Object *parent)
348{ 325{
@@ -386,14 +363,6 @@ elm_actionslider_add(Evas_Object *parent)
386 return obj; 363 return obj;
387} 364}
388 365
389/**
390 * Set actionslider indicator position.
391 *
392 * @param obj The actionslider object.
393 * @param pos The position of the indicator.
394 *
395 * @ingroup Actionslider
396 */
397EAPI void 366EAPI void
398elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) 367elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
399{ 368{
@@ -407,14 +376,6 @@ elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
407 edje_object_part_drag_value_set(wd->as, "elm.drag_button_base", position, 0.5); 376 edje_object_part_drag_value_set(wd->as, "elm.drag_button_base", position, 0.5);
408} 377}
409 378
410/**
411 * Get actionslider indicator position.
412 *
413 * @param obj The actionslider object.
414 * @return The position of the indicator.
415 *
416 * @ingroup Actionslider
417 */
418EAPI Elm_Actionslider_Pos 379EAPI Elm_Actionslider_Pos
419elm_actionslider_indicator_pos_get(const Evas_Object *obj) 380elm_actionslider_indicator_pos_get(const Evas_Object *obj)
420{ 381{
@@ -432,16 +393,6 @@ elm_actionslider_indicator_pos_get(const Evas_Object *obj)
432 return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT); 393 return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT);
433} 394}
434 395
435/**
436 * Set actionslider magnet position.
437 *
438 * @param obj The actionslider object.
439 * @param pos Bit mask indicating the magnet positions.
440 * Example: use (ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
441 * to put magnet property on both positions
442 *
443 * @ingroup Actionslider
444 */
445EAPI void 396EAPI void
446elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) 397elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
447{ 398{
@@ -451,14 +402,6 @@ elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
451 wd->magnet_position = pos; 402 wd->magnet_position = pos;
452} 403}
453 404
454/**
455 * Get actionslider magnet position.
456 *
457 * @param obj The actionslider object.
458 * @return The positions with magnet property.
459 *
460 * @ingroup Actionslider
461 */
462EAPI Elm_Actionslider_Pos 405EAPI Elm_Actionslider_Pos
463elm_actionslider_magnet_pos_get(const Evas_Object *obj) 406elm_actionslider_magnet_pos_get(const Evas_Object *obj)
464{ 407{
@@ -468,18 +411,6 @@ elm_actionslider_magnet_pos_get(const Evas_Object *obj)
468 return wd->magnet_position; 411 return wd->magnet_position;
469} 412}
470 413
471/**
472 * Set actionslider enabled position.
473 *
474 * All the positions are enabled by default.
475 *
476 * @param obj The actionslider object.
477 * @param pos Bit mask indicating the enabled positions.
478 * Example: use (ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
479 * to enable both positions, so the user can select it.
480 *
481 * @ingroup Actionslider
482 */
483EAPI void 414EAPI void
484elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) 415elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
485{ 416{
@@ -489,16 +420,6 @@ elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
489 wd->enabled_position = pos; 420 wd->enabled_position = pos;
490} 421}
491 422
492/**
493 * Get actionslider enabled position.
494 *
495 * All the positions are enabled by default.
496 *
497 * @param obj The actionslider object.
498 * @return The enabled positions.
499 *
500 * @ingroup Actionslider
501 */
502EAPI Elm_Actionslider_Pos 423EAPI Elm_Actionslider_Pos
503elm_actionslider_enabled_pos_get(const Evas_Object *obj) 424elm_actionslider_enabled_pos_get(const Evas_Object *obj)
504{ 425{
@@ -508,16 +429,6 @@ elm_actionslider_enabled_pos_get(const Evas_Object *obj)
508 return wd->enabled_position; 429 return wd->enabled_position;
509} 430}
510 431
511/**
512 * Set actionslider labels.
513 *
514 * @param obj The actionslider object
515 * @param left_label The label which is going to be set.
516 * @param center_label The label which is going to be set.
517 * @param right_label The label which is going to be set.
518 *
519 * @ingroup Actionslider
520 */
521EAPI void 432EAPI void
522elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label) 433elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label)
523{ 434{
@@ -541,16 +452,6 @@ elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char
541 edje_object_part_text_set(wd->as, "elm.text.center", center_label); 452 edje_object_part_text_set(wd->as, "elm.text.center", center_label);
542} 453}
543 454
544/**
545 * Get actionslider labels.
546 *
547 * @param obj The actionslider object
548 * @param left_label A char** to place the left_label of @p obj into
549 * @param center_label A char** to place the center_label of @p obj into
550 * @param right_label A char** to place the right_label of @p obj into
551 *
552 * @ingroup Actionslider
553 */
554EAPI void 455EAPI void
555elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) 456elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label)
556{ 457{
@@ -565,14 +466,6 @@ elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, con
565 if (right_label) *right_label = wd->text_right; 466 if (right_label) *right_label = wd->text_right;
566} 467}
567 468
568/**
569 * Get actionslider selected label.
570 *
571 * @param obj The actionslider object
572 * @return The selected label
573 *
574 * @ingroup Actionslider
575 */
576EAPI const char * 469EAPI const char *
577elm_actionslider_selected_label_get(const Evas_Object *obj) 470elm_actionslider_selected_label_get(const Evas_Object *obj)
578{ 471{
@@ -595,14 +488,6 @@ elm_actionslider_selected_label_get(const Evas_Object *obj)
595 return NULL; 488 return NULL;
596} 489}
597 490
598/**
599 * Set the label used on the indicator object.
600 *
601 * @param obj The actionslider object
602 * @param label The label which is going to be set.
603 *
604 * @ingroup Actionslider
605 */
606EAPI void 491EAPI void
607elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) 492elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label)
608{ 493{
@@ -614,14 +499,6 @@ elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label)
614 edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label); 499 edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label);
615} 500}
616 501
617/**
618 * Get the label used on the indicator object.
619 *
620 * @param obj The actionslider object
621 * @return The indicator label
622 *
623 * @ingroup Actionslider
624 */
625EAPI const char * 502EAPI const char *
626elm_actionslider_indicator_label_get(Evas_Object *obj) 503elm_actionslider_indicator_label_get(Evas_Object *obj)
627{ 504{