Getting the different post statuses + count like in edit.php, in a custom submenu page

The class used in edit.php is an extension of the WP_List_Table: WP_Posts_List_Table. See wp-admin/includes/class-wp-posts-list-table.php.

And here you find a call to wp_count_posts( $type="post", $perm = '' ). The first parameter is for the post type, the second can be empty or readable. If it is readable and the current user has no permission to see private posts these posts will be excluded. That’s what WP_Posts_List_Table does in get_views().

If you call this function without any arguments on the front page you get something like this:

stdClass Object
(
    [publish] => 19
    [future] => 1
    [draft] => 6
    [pending] => 0
    [private] => 0
    [trash] => 8
    [auto-draft] => 42
    [inherit] => 0
)